A Sun Capital Partners affiliate will buy Friendly Ice Cream Corp. for $337.2 million in cash.

The deal announced Sunday is expected to close during the third quarter. Shareholders will receive $15.50 per share from Freeze Operations Holding Corp., according to a statement.

The offer represents an 8.2 percent premium over the closing price of Friendly's common stock on Friday, the company said in the statement.

The deal has been unanimously endorsed by Wilbraham-based Friendly's board of directors, which will recommend that shareholders approve the deal. Key individual and institutional investors who collectively own more than 50 percent of the company's stock agreed to vote for the transaction, according to the statement.

The deal requires support from 66 percent of shareholders and is subject to other closing conditions.

On March 7, Friendly said it will consider putting itself up for sale, and that it swung to a profit in the fourth quarter.

"We believe this transaction delivers very attractive value to our shareholders, and it does so more quickly and with greater certainty than other alternatives we examined," Friendly President and Chief Executive Officer George Condos said.

Friendly's was started in Springfield in 1935 by brothers Prestley and Curtis Blake. Prestley Blake sold the company in 1979, but he remains a major shareholder and vociferous critic of the company's current management.

Friendly's now runs a chain of 514 company-owned and franchise restaurants in the Northeast and distributes ice cream through more than 4,500 supermarkets and other retail locations.

"Friendly's is an iconic brand name in the family restaurant sector and we are excited to add this great franchise to our portfolio of restaurant investments. We look forward to working with management to build on the legacy of this great brand and reinvigorate and expand the company within and beyond their historical markets," said Gary Talarico, managing director for Sun Capital Partners Inc.