Labor Day celebrations came early for employees of the New England supermarket chain Market Basket, whose operations had been brought to a near standstill when workers, managers and even customers protested a shake-up in its boardroom.

Employees rallied on picket lines outside of the chain’s 71 stores and on social media in support of the company’s former president Arthur T. Demoulas — known affectionately by his supporters as Artie T. or A.T.D. — who had been pushed out by his cousin, Arthur S. Demoulas, after a longstanding family-business rivalry. Employees’ efforts paid off when an agreement was reached late Wednesday allowing Arthur T. and his allies, who owned 49.5 percent of the company’s shares, to buy out Arthur S. and his allies’ 50.5 percent stake for $1.6 million to regain control of the business.