A six-week standoff between thousands of employees of a New England supermarket chain and management has ended with the news that the beloved former CEO is back in control after buying the entire company.

Tractor-trailers bearing the Market Basket logo and laden with the tons of food it will take to restock the chain’s 71 stores in Massachusetts, New Hampshire and Maine, as well as vendor vehicles, pulled up to loading docks before business Thursday, just hours after the announcement late Wednesday that Arthur T. Demoulas paid $1.5bn for shares of the company owned by the rival family faction, led by cousin Arthur S Demoulas.

Market Basket said in a statement late Wednesday that Demoulas would be returning to the company and that he and his management team would handle day-to-day operations while the purchase is completed.

“All associates are welcome back to work with the former management team to restore the company back to normal operations,” Demoulas said in a statement

“I feel like I won the lottery,” Market Basket truck driver Buddy Wemmers told The Boston Globe.

“I’m thrilled, this is epic,” said Tom Trainor, a district supervisor, told the Boston Herald.

Gary Sessa, a front end manager at the chain’s Tewksbury store, told WFXT-TV that company bakers came in at midnight after hearing the news and started baking cakes that say “Welcome back Artie T: Market Basket Strong.”

The company’s two current CEOs, Felicia Thornton and Jim Gooch, are to remain in place until the deal is closed, within the “next several months.”

Demoulas was ousted in June by a board of directors controlled by Arthur S. Demoulas, causing workers to stage protests. Hundreds of warehouse workers and drivers refused to deliver food, leading to empty shelves and tens of millions in lost revenue. Customers stopped shopping at Market Basket, with some even taping their receipts from competitors in Market Basket store windows.

The crisis even prompted Massachusetts Governor Deval Patrick and New Hampshire Governor Maggie Hassan to help negotiations.

“We are delighted that the parties have reached agreement on terms of sale and resolution of operating authority, so that employees can return to work and customers will once again be able to rely on these stores to meet their needs,” the governors said in a joint statement.

After the company fired eight supervisors who helped organize the revolt, public support for the workers intensified.

More than 160 mayors and legislators in Massachusetts and New Hampshire signed petitions agreeing to boycott Market Basket. The stores, usually jam-packed with shoppers attracted by the chain’s low prices, have had only a trickle of customers for weeks.

Business analysts said the worker revolt was remarkable at a family-owned, non-union company, particularly because the workers were not seeking higher wages or better benefits, but instead were calling for the return of their CEO. The workers credit Arthur T. Demoulas for treating them like family, keeping prices low and leading the company’s success.

Renee Mulhane, a part-time Market Basket employee in Tewksbury, said late Wednesday she was hoping an agreement was reached so that she could return to the job she held for 13 years before being laid off two weeks ago.

“It has been inspiring the amount of support the public has shown,” the workers, she said. The situation has “been draining, but inspiring.”

Infighting in the Demoulas family has gone on for decades, but this was the first time the family’s squabble had such a deep impact on Market Basket stores.

Demoulas had offered to buy the 50.5% of the company owned by his cousin and other relatives on his side of the family. Demoulas had said Friday he had submitted his final bid to buy out his rivals’ share in the New England company on 21 August.

Market Basket stores have long been a fixture in New England. The late Arthur Demoulas, a Greek immigrant who was the grandfather of Arthur T and Arthur S, opened the first store in Lowell nearly a century ago.