Private equity firm KKR & Co LP will buy industrial machinery maker Gardner Denver Inc for $3.74 billion, four months after the company put itself up for sale.

KKR's offer of $76 per share is at a premium of 3 percent to Gardner Denver's Thursday closing price on the New York Stock Exchange. It is 39 percent above what the stock traded at in late October when the company said it was exploring a sale.

Gardner Denver, which makes compressors, pumps and vacuum products for industrial uses, decided to put itself up for sale following months of pressure from activist investor ValueAct Capital LLC, which reported a roughly 5 percent stake in July 2012.

New York-based KKR has been in the pole position to buy Gardner Denver after other private equity bidders who initially took part in the auction abandoned the process ahead of the Feb. 21 deadline for final bids, people familiar with the matter told Reuters.

The deal is valued at $3.9 billion including debt, the companies said in a statement.

Based on 49.15 million Garden Denver shares outstanding as of Jan. 31, the equity portion of the deal is valued at $3.74 billion.

In late February, KKR bid $75 per share for Gardner Denver but the company sought a higher offer, according to the sources.

Diversified manufacturer SPX Corp had also been in talks to buy Gardner Denver at $85 per share but abandoned plans after its shareholders questioned the logic of a merger.

KKR and Gardner Denver said they expected the deal to close in the third quarter of 2013.

Wayne, Pennsylvania-based Gardner Denver late last month forecast 2013 earnings well below analysts' expectations on weak demand for its pumps.

Its shares had lost about 45 percent of their value in the 12 months before ValueAct first reported its stake.

Goldman Sachs advised Gardner Denver while UBS Securities and Simmons & Co International served as financial advisers to KKR.