J.P. Morgan Securities rigged bids in at least 93 municipal bond deals in 31 states for eight years beginning in 1997, the Securities and Exchange Commission charged Thursday.

The government said the firm agreed to pay $228.2 million to settle charges by the SEC and other state and federal authorities, including the Justice Department, the Internal Revenue Service, the Office of the Comptroller of the Currency and the Federal Reserve Bank of New York.

Municipal bonds are supposed to be safe, tax-exempt investments that help local governments and nonprofit organizations fund public works projects such as roads, bridges, schools and hospitals. But recent enforcement actions have portrayed this seemingly staid corner of the banking world as having been a feasting ground for corrupt financiers.

Institutions in line to receive restitution from J.P. Morgan include Johns Hopkins Hospital and the University of Maryland Medical System, the Maryland attorney general’s office said. David Paulson, a spokesman for the office, said he could not disclose how much they would be receiving.

The District of Columbia will also share in the recovery, but it was only marginally involved and stands to receive about $22,000, said Bennett Rushkoff, chief of the public advocacy section of the District attorney general’s office.

Thursday’s settlement was another mark against J.P. Morgan Chase, parent of the securities firm.

Last month, J.P. Morgan Securities agreed to pay $153.6 million for allegedly selling investors a complex investment that was secretly designed to help a hedge fund profit at their expense.

In 2006, the SEC charged J.P. Morgan Securities with abuses in the market for another type of investment known as auction-rate securities. In that case, the firm agreed to pay a $1.5 million fine.

The fraud alleged on Thursday involved transactions in which municipalities temporarily invest the money they raise by issuing bonds. To ensure they are getting a fair return on their money, municipalities typically invite competitive bids for investment options, using bidding agents to help them obtain the best deal.

J.P. Morgan Securities won the bidding in some transactions because it obtained information from the agents about competing bids, the SEC charged. In other instances, the bidding was rigged in J.P. Morgan’s favor, and in still other deals, J.P. Morgan helped other parties win by deliberately submitting losing bids, the agency said.

“Municipal issuers and investors didn’t stand a chance against the fraudulent strategies [J.P. Morgan Securities] and others used to guarantee profits,” Robert Khuzami, the SEC’s enforcement director, said in a statement.

The firm neither admitted nor denied wrongdoing in its settlement with the SEC. But in its settlement with the Justice Department, it admitted to illegal anti-competitive conduct by former employees. Under its agreement with Justice, the firm avoided prosecution.

“The investigations focused on a small desk that was discontinued and on certain employees who are no longer with the firm,” J.P. Morgan Chase said in a statement. “These employees concealed their conduct from management.”

The SEC said the fraud took place from 1997 through 2005; the Justice Department said the manipulations it targeted spanned 2001 through 2006.

A former J.P. Morgan vice president, James L. Herz, pleaded guilty to related conspiracy and fraud charges in November, the SEC said.

Thursday’s settlement is “not expected to have any material impact on the firm’s earnings,” the bank said.

The case against J.P. Morgan was the third settlement in the SEC’s investigation of corruption in municipal bond reinvestment deals. Earlier settlements involved Bank of America Securities and UBS Financial Services.