The Ballymena operation, famous for building London buses, was placed into administration last month with the loss of 1,200 jobs.
English industrialist Jo Bamford announced on Friday that he had agreed a deal in principle to buy the factory and associated lands from former business owner Jeff Wright.
A dispute over the sale of those assets had been the sticking point preventing an overall purchase of the business.
While the company is in the hands of the administrators, the factory and associated lands are still controlled by Mr Wright.
Mr Bamford and Mr Wright were at loggerheads over the asset sale, a stand-off that had put the sale of the Wrightbus operation in jeopardy.
On Friday, the men announced the resolution of that issue.
Mr Bamford, who is the son of JCB chairman Lord Bamford, expressed hope he could now complete the overall purchase with administrators Deloitte.
“We are delighted to announce that this morning I have agreed terms on a deal in principle with the Wright family for the Wrightbus factory and land,” he said.
“We are still to conclude a deal with the administrators but are pleased to report this important step in the right direction.”
Mr Bamford thanked North Antrim MP Ian Paisley for helping to mediate what he described as a “tricky negotiation”.
A statement from Jeff Wright’s representative confirmed the deal.
“Following intensive overnight negotiations between the two parties agreement has been reached in principle over the sale of Wrightbus to Ryse Hydrogen (Mr Bamford’s company),” it said.
“The two men at the centre of the deal, Jeff Wright and Jo Bamford, say the outcome of the negotiations involved pragmatism in arriving at an arrangement which is ultimately in the best interests of the long-term sustainability of the bus manufacturing business and jobs in the Ballymena area.
“The two businessmen confirmed that the Wrightbus factory has been saved from liquidation with Jo Bamford as the new owner of the business.”
Farmlands close to the factory premises had been at the heart of the dispute.
Mr Wright said as part of the deal he had agreed to gift the farmlands to Mid and East Antrim Council to acknowledge the contribution of Ballymena people to the Wrightbus brand over 70 years.
“This legacy gift is a tribute not only to my father, his father before him, and the Wright family members but most importantly it is a tribute to the generations of workers who helped build a proud manufacturing tradition in Ballymena,” he said.
“It is my true wish to see this legacy used for the purposes of expanding manufacturing and benefiting our local community.”
Mr Wright said the council had confirmed the lands would be used for a proposed innovation centre for manufacturing start-up companies.
“I believe the presence of this centre on the Wrightbus legacy land will send a clear message to Northern Ireland and beyond that Ballymena has a strong future in advanced manufacturing,” he added.
“The Mid and East Antrim Borough Council estimates that the legacy of the site and the new investment would result in 2,460 jobs with the potential to rebuild Ballymena.
“It is also has ambitious plans to secure one of the Heathrow Hubs for the town which would see a further 5,000 engineering and manufacturing jobs for the area.
“The new innovative Hubs are to be used to pre-assemble components of the expanded airport before transporting them to Heathrow.”
North Antrim MP Ian Paisley said: “I welcome the announcement today by Jo Bamford that after weeks of hard work a deal has now been made on the Wrightbus sight and is concluding the final arrangements with the administrator to take over Wrightbus and get men and women back to work building busses in Ballymena.
“I am delighted that after asking Jo Bamford to consider Ballymena as a location for a significant business investment this has resulted in this deal.
“The farm land that will be a legacy to William Wright’s industrial prowess is a fitting tribute to him and i know that Jo Bamford will work with the council on making sure that is used accordingly.
“To the workers of Ballymena I salute your fortitude and patience and hope you are never put through something like this again.”