Toyota Motor Corp will fix the accelerator pedals in four million cars and trucks to address a safety issue linked to bursts of sudden acceleration and deadly accidents, the company and the US government said.

The action, which represents the largest-ever US safety recall by the Japanese automaker, aims to address the risk that floor mats in the vehicles can come loose and trap the accelerator pedal on some of Toyota's most popular models including the Camry and hybrid Prius.

Toyota had initially urged owners to remove floor mats in affected vehicles sold over the last six years.

But under the more sweeping and costly recall detailed on Wednesday, Toyota said it would reconfigure and replace accelerator pedals and take other steps after an investigation by the National Highway Traffic Safety Administration.

Toyota said it would install a new brake override system on five models starting next year that will cut power to the engine when the brake pedal is applied even if the accelerator is also engaged.

On Camry and Avalon and Lexus ES350 models, the automaker will also reshape the floor of the vehicle to create more space under the accelerator pedal.

The company was still calculating the cost of the recall, a spokesman in Tokyo said.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.