WASHINGTON  The pharmaceutical giant Pfizer agreed to pay $2.3 billion to settle civil and criminal allegations that it had illegally marketed its painkiller Bextra, which has been withdrawn.

It was the largest health care fraud settlement and the largest criminal fine of any kind ever.

Although the investigation began and largely ended during the Bush administration, top Obama administration officials held a news conference on Wednesday to celebrate the settlement, thank each other for resolving it and promise more crackdowns on health fraud.

“It’s another step in the administration’s ongoing effort to prosecute any individual or organization that tries to rip off health care consumers and the federal government,” said Kathleen Sebelius, secretary of health and human services.

Republicans and Democrats on Capitol Hill have accused the Obama administration of failing to crack down adequately on health care fraud, arguing that huge savings in government health programs could be found with better enforcement. The settlement had been expected. Pfizer, which is acquiring a rival, Wyeth, reported in January that it had taken a $2.3 billion charge to resolve claims involving Bextra and other drugs. It was Pfizer’s fourth settlement over illegal marketing activities since 2002.