(Photo by Mark Sardella)

Armed with a battalion of lawyers, warring factions of the family-owned Market Basket grocery stores announced a truce Thursday in their fight for control of the chain, with minority shareholders agreeing to buy out majority shareholders.

The deal was marked by plenty of economic, political and family intrigue surrounding two arms of the owning family: the majority shareholders headed up by Arthur S. Demoulas and the minority shareholders led by Arthur T. Demoulas. Arthur S.’s faction ousted Arthur T. from his role as CEO after gaining control of the company’s board earlier this summer, but Arthur T.—known affectionately as “Artie T” to employees and customers—resumed his role as CEO immediately as part of Thursday’s deal.

Teams from Jones Day; Curtis, Mallet-Prevost, Colt & Mosle; and Boston’s Davis, Malm & D’Agostine represented the sellers on the deal, which is reported to be worth more than $1.5 billion. Skadden, Arps, Slate, Meagher & Flom advised the buyers, while Ropes & Gray counseled a committee of the company’s board.

Curtis, Mallet-Prevost M&A cochair Lawrence Goodman, who worked on the deal for a group of the sellers, told us Thursday that it is “one of the most unique transactions I’ve ever been involved with.”

The Demoulas saga has become much more than a family food fight in the Northeast, where Market Basket has 71 stores in Massachusetts, New Hampshire and Maine and 25,000 employees. The chain sprang from a single, local Greek grocer in Lowell, Mass., founded in 1917. The family feud began in the 1990s as Arthur S.’s family claimed that Arthur T.’s father had wrongfully transferred their company shares to himself. Arthur S.’s family won a 1996 court ruling that gave them their 50.5 percent stake, but the minority shareholders maintained control of the company’s board until this summer, just prior to Arthur T.’s firing in June. The ouster of “Artie T.” led employees to walk off the job and customers to boycott the store, with some even posting their receipts from rival stores on Market Basket windows to lodge their complaints.

Massachusetts Gov. Deval Patrick stepped in to help broker a deal between the family factions, although his presence raised the specter of a conflict of interest since his wife, Diane, is comanaging partner of the Boston office of Ropes & Gray, the firm that represented Market Basket’s independent board members. The public relations firm representing the independent directors released a statement earlier this month saying that Diane Patrick had not been involved in the firm’s work for the directors or committees of the board.

The Boston Globe reported that Artie T.’s faction had tapped an unnamed private equity firm for $500 million of the $1.5 billion-plus price paid to buy out the 50.5 percent of the company owned by rival family members. The remaining $1 billion-plus is set to come from a cash payment from Artie T. and his sisters, along with a mortgage loan secured by the company’s real estate holdings.

The Boston-based Skadden team working for Artie T. on the deal includes litigation partner Thomas Dougherty and M&A partner Margaret “Peggy” Brown, whom we previously named Dealmaker of the Week in 2009 for her work on EMC Corporation’s $2.4 billion acquisition of Data Domain. Dougherty and Brown didn’t immediately respond to our calls. The Skadden M&A team also included tax partner Clifford Gross, antitrust and competition partner Clifford Aronson, real estate partner Vered Rabia and banking partner K. Kristine Dunn. Counsel Andrew Kopans, Laura Knoll, Russell Wohl and Paul Schockett also worked on the deal, along with associate Nathaniel Adams.

The sellers were represented by counsel at Jones Day, Curtis Mallet-Prevost and Boston’s Davis Malm. The Jones Day deal team was led by New York M&A partners Robert Profusek and Randi Lesnick and included tax partner Edward Kennedy. Reached Thursday, Profusek declined to comment on the deal.

Goodman took the lead for Curtis Mallet-Prevost with a team that included counsel Joshua Geller. Davis Malm’s Thomas Fitzpatrick provided local counsel.

We reached out to Ropes & Gray’s M&A group cohead Jane Goldstein to clarify the firm’s role in the deal, but a spokeswoman said via email that Ropes & Gray has “no comment at this time.”