In the largest Medicaid fraud settlement, Bayer agreed yesterday to pay the government $257 million and pleaded guilty to a criminal charge after engaging in what federal prosecutors said was a scheme to overcharge for the antibiotic Cipro.

According to documents turned over to the government by a whistle-blower, Bayer was coached in the scheme by a purchasing manager from Kaiser Permanente, one of the nation's largest health care organizations.

The fraud involved selling Cipro to Kaiser at prices lower than the company was charging Medicaid, in violation of a federal law that requires drug makers to give the Medicaid program the lowest price charged to any customer. To cover up the fraud, the Cipro bottles sold to Kaiser were relabled with Kaiser's name and given a different drug identification number.

In announcing the settlement yesterday, prosecutors in the United States attorney's office in Boston did not charge Kaiser with any wrongdoing. Prosecutors declined to comment on Kaiser yesterday and said the investigation was continuing.

"There is a commitment to pursuing those who cheat the federal health care programs in any way," said Susan G. Winkler, an assistant United States attorney.

The five-year scheme by Bayer, which unfolded before the 2001 anthrax scare caused a run on Cipro, shows the lengths to which some drug companies will go to profit on the nation's complex prescription drug laws. Rules allow drug makers to keep most pricing data secret. Recently, federal prosecutors have begun focusing on similar pricing schemes as drug costs continue to rise and as whistle-blowers have come forward with documents detailing activities.

Prosecutors also announced yesterday that GlaxoSmithKline had agreed to pay $87.6 million to settle civil charges that it had overcharged the Medicaid program for Paxil, an antidepressant, and Flonase, an allergy spray. That deal also involved relabeling medicines for Kaiser, prosecutors said.

The money from the settlements will be divided by the federal and state governments, which jointly pay for Medicaid. A portion will also go to public health clinics, AIDS programs and other groups that are allowed to buy medicines at the Medicaid price.

About $34 million of the Bayer settlement will go to the estate of a former executive at the drug maker who became a whistle-blower. George J. Couto, the whistle-blower, died in November from cancer at the age of 39.

Bayer, based in Germany, said yesterday that it was pleased to have the matter resolved. The company said it believed that its marketing practices "were responsible and conducted in good faith." It said it did not believe that the settlement would affect its continuing business with the government.

In a brief statement, Kaiser said it believed that its employees acted in accordance with the law. It said it had been cooperating with investigators for more than three years and would continue to do so.

GlaxoSmithKline said it had agreed to the settlement to avoid the delay and expense of a trial. The company said it "continues to believe that its interpretation of the law was reasonable and in good faith."

Bayer's Cipro scheme began in 1995 when Kaiser threatened to stop buying the antibiotic after Johnson & Johnson offered its medicine, Floxin, at a much lower price, according to documents, including internal memos, that Mr. Couto gave to prosecutors.

Bayer was desperate to keep the business of Kaiser, a nonprofit health insurer with eight million members, according to documents. Kaiser was buying about $7 million of Cipro each year. In addition, other health groups often follow Kaiser's lead in drug-buying decisions.

But if Bayer offered to beat the price offered by Johnson & Johnson, Cipro's new price would fall below what Bayer was charging Medicaid, forcing it to pay tens of millions of dollars in additional rebates.

Alan Mello, a market manager for Bayer, looked for a way to avoid paying the rebates, according to documents. His suggestions included a plan to switch Kaiser patients who were taking Cipro tablets to an injectable form of the drug, which was not subject to the lowest-price requirement, called the best price law. Kaiser rejected that proposal.