Toyota (TM) on Wednesday reached a $1.2 billion settlement with the U.S. Department of Justice, ending a criminal investigation into issues that caused inadvertent acceleration of certain vehicles.

The Japanese automaker came under fire for its response to claims that certain vehicles were suddenly accelerating. Toyota’s first recall came in September 2009, when the Japanese automaker said 3.8 million Toyota and Lexus cars had floor mats that could cause accelerator pedals to jam.

Additional recalls were issued to fix “sticking” gas pedals. By the end of 2010, the company recalled more than 10 million vehicles, and the National Highway Traffic Safety Administration said five deaths were connected to the defects.

The DOJ had been investigating Toyota’s disclosure of those safety problems for four years. The FBI’s New York field office led the probe, which was opened in February of 2010 and involved more than 70 interviews by the agency, according to a source familiar with the investigation.

Under the settlement, Toyota admitted that it misled consumers by making deceptive statements regarding the two issues that caused sudden acceleration, according to the DOJ.

During a news conference, Attorney General Eric Holder said Toyota treated a public safety emergency as a public relations issue, calling the company’s conduct “shameful.”

The deal, which marks the largest penalty ever imposed by the government on a car manufacturer, also includes independent monitoring of Toyota’s safety practices and deferred prosecution for three years on a wire fraud charge.

“Entering this agreement, while difficult, is a major step toward putting this unfortunate chapter behind us,” said Christopher P. Reynolds, Toyota North America’s chief legal officer.

Reynolds added that Toyota has already made changes to “become a more responsive company,” such as enhancing quality control and creating rapid-response teams to quickly investigate customer concerns.

“At the time of these recalls, we took full responsibility for any concerns our actions may have caused customers, and we rededicated ourselves to earning their trust,” Reynolds said. “In the more than four years since these recalls, we have gone back to basics at Toyota to put our customers first.”

The agreement follows extensive fines and litigation costs for Toyota, the world’s largest automaker. NHTSA fined the company four separate times for a combined total of $66.2 million, saying Toyota failed to promptly disclose defects.

Toyota was also met with lawsuits from car owners claiming the vehicles were defective and lost their value. The company has fought those allegations, arguing that misplaced floor mats were the cause of the issue. Toyota settled those suits, which were seeking about $1.6 billion in damages.

Reynolds said Toyota continues to stand behind the safety and quality of the affected vehicles. The company fixed the sticky pedals and troublesome floor mats “with effective and durable solutions,” he added.

Toyota plans to take a $1.2 billion after-tax charge in the fiscal year ending March 31 to cover the cost of Wednesday’s agreement.

U.S. shares of Toyota fell 90 cents, or 0.8%, to $108.93 in recent trading.

Earlier this week, rival General Motors (GM) said it would record $300 million in charges related to an ignition-switch recall and three separate issues.

The top U.S. automaker has drawn the ire of Congress and the DOJ, both of which are investigating the timing of a recall that includes 1.37 million domestic vehicles with faulty ignition switches.

Holder said the Toyota settlement will serve as a “model” for how the DOJ treats similar cases involving other automakers.

FOX Business reporters Rich Edson and Adam Samson contributed to this report.

Follow Matthew Rocco on Twitter @MatthewRocco