German drugs giant Bayer said Monday it and its US partner Janssen Pharmaceuticals had agreed in principle to jointly pay nearly $800 million to settle a legal dispute over anticoagulant Xarelto.

The cost would be shared equally by both companies to resolve almost all of the "approximately 25,000 Xarelto claims in the United States," Leverkusen-based Bayer said in a statement.

Both companies reserved the right to withdraw from the $775 million (685 million euro) settlement if an insufficient number of plaintiffs accept it, Bayer said.

"More than five years after the Xarelto litigation began, and with Bayer and Janssen Pharmaceuticals prevailing in all six cases that went to trial, the companies have reached an agreement in principle to settle in the amount of 775 million US dollars," Bayer said in a statement.

While plaintiffs have claimed side effects, the German company has insisted that its medication has been successfully prescribed to 45 million people around the world.

"Bayer continues to believe these claims are without merit and there is no admission of liability under the agreement," it said.

"However, this favourable settlement allows the to avoid the distraction and significant cost of continued litigation."

Bayer and Janssen, a subsidiary of Johnson & Johnson, jointly developed the oral anticoagulant drug, and Janssen markets it in the United States.

The deal comes as Bayer faces far bigger legal troubles following its takeover of agrochemicals giant Monsanto, whose glyphosate weedkillers Roundup and Ranger Pro have been linked by litigants to cancer.