Bayer won over Monsanto's management with a $128 per-share cash offer to acquire the global seed market leader, a person familiar with the matter said, in a move to command more than a quarter of the combined world market for seeds and pesticides.

Bayer has signed a deal that includes a fee of $2 billion should the transaction fail to get regulatory clearance as planned, the person said. The deal is expected to close by the end of 2017, the source told Reuters on Wednesday.

Monsanto and Bayer were not immediately available for comment.

Shares in Bayer extended gains to trade 3 percent higher on the news.

At a total deal value of close to $66 billion - based on 442 million Monsanto shares and the U.S. group's net debt of $9.3 billion as per end-May - it will be the largest transaction ever involving a German buyer.

It would trump Daimler's merger deal with Chrysler in 1998, which valued the U.S. carmaker at more than $40 billion. It will also be the largest all-cash transaction on record, ahead of brewer InBev's $60.4 billion offer for Anheuser-Busch in 2008.

The two companies were in talks to sound out ways to combine their businesses as early as March, which culminated in Bayer coming out with an initial $122 per-share takeover proposal in May.