Drugmakers Bayer AG and GlaxoSmithKline agreed to pay the largest Medicaid fraud settlements ever negotiated to resolve allegations that they overcharged the government health insurance program for poor people, a federal prosecutor said.

Bayer will pay the government more than $250 million, and Glaxo will pay almost $88 million for failing to give the Medicaid program the lowest price charged to any customer, said U.S. Attorney Michael J. Sullivan, whose office in Boston helped negotiate the agreement.

Bayer said it set aside $257 million last year to cover the cost.

The settlements will be shared by the federal government, the District of Columbia and all the states except Arizona.

Under the agreement, Bayer will plead guilty to violating the Federal Prescription Drug Marketing Act, Sullivan's office said. It will pay a criminal fine of about $5.6 million for alleged overcharges involving Cipro, an antibiotic, and Adalat, a drug to control blood pressure. Bayer will pay about $251.6 million in civil penalties.

Glaxo agreed to pay a civil fine for overcharging Medicaid for the antidepressant Paxil and the nasal allergy spray Flonase. Glaxo was not accused of a crime.

Sullivan said both companies offered discounts to Kaiser Permanente -- the nation's largest health maintenance organization -- for their drugs. The drugs were then relabeled, which allowed the companies to avoid reporting the low prices given to Kaiser and to avoid paying millions of dollars in rebates to Medicaid.

Under the law, drug companies are required to report all their prices and to pay Medicaid a rebate if they charge anyone less than they do the government.

Sullivan would not elaborate on why Bayer was charged with a crime while Glaxo was not, but he said the conduct engaged in by the two companies was not identical.

Sullivan said that at a time of state budget deficits and skyrocketing prices for prescription drugs, withholding funding from Medicaid can have a devastating impact on efforts to provide drug coverage for the poor.

Glaxo said in a prepared statement that the sole issue in the case was how it interpreted an "ambiguous aspect" of the law. The company said it agreed to the civil settlement to avoid the delay and expense of trial.

Peter Lurie, deputy director of Public Citizen's Health Research Group in Washington, said such settlements could help control drug costs.

"In other countries -- through a variety of different mechanisms -- they negotiate prices, they establish profit margins, and there's a transparency to the process that tends to mitigate the possibility of this kind of fraud," Lurie said. "But in this kind of non-transparent program, there's an invitation to fraud."

State and federal prosecutors are in the midst of several investigations into drug manufacturers.

TAP Pharmaceutical Products Inc., Pfizer Corp. and Bristol-Myers Squibb reached separate agreements to settle multimillion-dollar complaints. Attorneys general from 47 states are investigating whether Pfizer illegally marketed the epilepsy drug Neurontin.

The Bayer investigation was prompted by George Couto, a Bayer marketing executive who became a whistle-blower. In 1999, Couto reported his concerns to his boss, according to his New York lawyer, Neil V. Getnick. When the company did nothing about his complaint, Couto, who has since died, took his claims to the Justice Department, Getnick said.