German chemical maker BASF has agreed to buy U.S. catalyst producer Engelhard for over $5 billion, clearing the way for the biggest takeover in BASF's 140-year history.

The agreement, announced on Tuesday, ends a five-month standoff which saw Engelhard rejecting BASF's original offer of $37 a share in January, and a revised bid of $38 in April.

BASF raised its bid again by $1 a share last week but warned that it would walk away from the deal if the latest price was not enough to win over shareholders.

Engelhard's board of directors unanimously approved the merger agreement and recommends all Engelhard shareholders tender their shares into BASF's tender offer, the U.S. company said in its statement.

BASF wants to buy Engelhard to reduce the cyclical nature of its business and mop up some of the cash that its integrated production generates.

Analysts said the agreement, which many had expected ahead of Engelhard's annual shareholder meeting planned originally for Friday but now postponed, was a good one for the German company.

It's an okay price, and the markets should take it positively, said Sal. Oppenheim analyst Ludger Mues.

It will begin to fetch returns in a couple of years, and reduces the cyclicality of BASF's portfolio.

Landesbank Rheinland-Pfalz analyst Silke Stegemann said that the acquisition made strategic sense for BASF.

We see as positive a takeover at less than $40 a share, she said.

Engelhard said it was withdrawing a plan to buy back around 20 percent of its shares at $45 apiece that many analysts saw as a bid to thwart the BASF offer.

BASF shares were down 1.3 percent at 63.72 euros at 1333 GMT, faring better than a 1.5 percent drop in the DAX bluechip index. Engelhard shares were up 0.7 percent at $38.94 in New York.

MORE ACQUISITIONS AHEAD?

The agreement to buy Engelhard rounds off a string of acquisitions made by BASF, including Degussa's construction chemicals unit for 2.7 billion euros and U.S. company Johnson Polymer for $470 million.

Analysts say BASF wants to complete the Engelhard deal ahead of a likely downturn in profitability at its chemicals unit, and that more deals could follow.

BASF has a solid balance sheet and generates enough operating cashflow to continue making acquisitions, said Sal. Oppenheim's Mues.

Most analysts expect the chemicals cycle, which is closely linked to profitability in the sector, to peak this year or next.

BASF's offer for Engelhard expires on June 5. Tuesday's agreement postpones Engelhard's annual shareholder meeting to June 30.

(With additional reporting by Kenneth Li in New York)