German drugmaker Merck KGaA (MRK) agreed Wednesday to sell its 21.8 percent stake in Schering AG to Bayer AG (BAY), learing the way for Bayer to take over Schering and end a merger drama that saw Merck in a position to block the takeover.

Merck will get 89 euros ($111.18) a share, compared with the 88 euros ($110.62) Bayer had said this week it was prepared to pay for Schering and above its initial 86 euros ($108.16) per share offer.

Bayer said that shareholders who had already tendered their stock for the deal would also receive 89 euros a share.

That means the total value of the deal is now estimated at about 16.9 billion euros ($21.2 billion), about 400 million euros ($501 million) more than Bayer's initial offer.

Shares of Bayer jumped nearly 8 percent to 33 euros ($41.48) after the announcement, reversing an earlier slide, while Merck shares jumped more than 5.6 percent to 72.30 euros ($90.88). Shares of Schering rose more than 2 percent to 88.96 euros ($111.83).

Bayer also said that, as part of the deal, it would withdraw a U.S. lawsuit it filed against Darmstadt-based Merck on Tuesday.

The decision came after all three companies held joint talks about Merck's move in the last few days to acquire shares of Schering on the open market.

"We're very pleased about Merck's decision, because a lengthy competitive bidding process would have greatly affected Schering's future," said Bayer Chief Executive Werner Wenning. "All three companies concerned will benefit from this step," he added.

He said he was optimistic that Bayer could now secure at least the three-quarters of Schering's stock it was aiming for and quickly begin the integration process.

As part of the talks Wednesday, Bayer said it and Merck agreed to more discussions about "further possible opportunities for cooperation between the two companies."

Founded in 1863, Bayer invented Aspirin in 1897 and has since gone on to make everything from vitamins to agricultural chemicals. Its best known products include Alka-Seltzer and One-A-Day vitamins. The company employs some 93,700 workers.

Schering, founded in 1851 as a pharmacy, has since grown to a corporation that employs 24,500 people worldwide. Schering's connection to its former U.S. subsidiary, Kenilworth, N.J.-based Schering-Plough, was broken during World War II and the companies are no longer related.

Merck, also founded as a pharmacy in 1668, is the oldest pharmaceutical business in the world. It has been entirely separate from Whitehouse Station, N.J.-based Merck & Co. since the end of World War I.