(Reuters) - Sheetrock maker USG Corp USG.N accepted a $7 billion cash offer from German construction products maker Gebr Knauf KG on Monday after three months of back-and-forth negotiations that began when longtime USG shareholder Warren Buffett teamed up with the German bidder to sell his stake.

FILE PHOTO: Berkshire Hathaway CEO Warren Buffett plays bridge during the Berkshire annual meeting weekend in Omaha, Nebraska May 3, 2015. REUTERS/Rick Wilking/File Photo

The companies agreed to a $44 per share deal, a bump from the $42 initially offered by the private German family-owned company in late March. Buffett’s Berkshire Hathaway Inc had a 31 percent stake in USG and has said previously it would offload its stake.

USG shares rose about 3.7 percent on Monday to $42.98.

USG opened the door to private talks after weeks of public resistance in early May ahead of its annual shareholder meeting, when proxy advisory firms Institutional Shareholder Services Inc (ISS) and Glass Lewis & Co sided with Buffett’s push to engineer talks.

USG had called the initial takeover offer “wholly inadequate, opportunistic” given the company’s improving fortunes under a turnaround plan.

USG CEO Jennifer Scanlon said on Monday that her company’s board had evaluated all strategic options to maximize value for shareholders and believes the deal will benefit employees and create new opportunities for both companies’ customers.

The price represents a premium of 31 percent to USG’s closing price of $33.51 before the talks started and a 36 percent premium to the $32.36 average closing price for the preceding 12-month period as of March 23, according to a statement.

The Berkshire Hathaway investment dates back to 2001, when Buffett helped the company out of bankruptcy with a loan that was later converted to a stake in the company’s equity so large that a wholesale acquisition of the entire company remained one of the few ways for Berkshire to exit the investment without pushing down the share price.

Knauf said the company will keep USG’s headquarters in Chicago.

Morgan Stanley MS.N was Knauf's financial adviser, while JPMorgan Chase JPM.N and Goldman Sachs GS.N advised USG. Baker McKenzie LLP, Shearman & Sterling LLP and Freshfields Bruckhaus Deringer were Knauf's legal advisers, while Jones Day was legal counsel to USG.