In this Jan. 6, 2012 file photo, a model poses near the new version of Hyundai Sonata displayed at the Hyundai stall during Auto Expo in New Delhi, India. On Friday, Sept. 25, 2015, Hyundai is recalling nearly a half-million midsize cars in the U.S. to replace key engine parts because a manufacturing problem could cause them to fail. The recall covers 470,000 Sonata sedans from the 2011 and 2012 model years equipped with 2-liter or 2.4-liter gasoline engines. (AP Photo/Saurabh Das)

DETROIT (AP) — Hyundai is recalling nearly a half-million midsize cars in the U.S. to replace the engines because a manufacturing problem could cause them to fail.

The recall covers 470,000 Sonata sedans from the 2011 and 2012 model years equipped with 2-liter or 2.4-liter gasoline engines. At the time, the Sonata was Hyundai’s top-selling vehicle in the U.S.

The company also is recalling nearly 100,000 Accent small cars because the brake lights can fail.

In documents on the Sonata recall posted Friday by the U.S. National Highway Traffic Safety Administration, Hyundai says that metal debris may not have been fully removed from the crankshaft area during manufacturing at Hyundai’s Alabama engine plant. That can restrict oil flow to the connecting rod bearings, and since they are cooled by oil, they could fail. If that happens, the engines could stall and cause a crash.

So far, Hyundai said it has no reports of crashes or injuries from the problem. The company said in documents that a worn connecting rod bearing will make a cyclical knocking noise, and it also could cause the oil pressure warning light to illuminate. Continued driving with the problem can cause the bearing to fail and engine stalling.

The company said that the 2011 Sonata was the first Hyundai vehicle to use engines made in Alabama, where the company initially used a mechanical process to remove machining debris from the crankshaft. That process was changed to a high pressure wet blasting system in April of 2012.

Hyundai discovered the problem when owners started reporting engine noise. In June of 2015, NHTSA raised the issue with Hyundai, which said it didn’t consider the issue to be a safety problem because owners would get warnings. But NHTSA told the company it was concerned about the possibility of high-speed stalling. Hyundai decided to recall the cars on Sept. 2, according to the documents.

Dealers will inspect the cars and replace engines at no cost to owners, a company spokesman said. The company also will increase the engine warranty for 10 years or 120,000 miles.

Owners will be notified Nov. 2, and they’ll get a second notice when the replacement engines are available.

Hyundai spokesman Jim Trainor declined to disclose how much it will cost to replace each engine.

The Accent recall covers certain 2009 to 2011 models. It’s an expansion of a recall issued in 2013. Hyundai says the brake light switch can fail, and the lights won’t come on when a driver steps on the brakes. Also, the cruise control may not be deactivated by stepping on the brake, and the gear shifter may get stuck in the “park” position.

The company says in documents posted by NHTSA that it has no reports of crashes or injuries.

Hyundai will replace the brake switch at no cost to owners starting Nov. 2, the company said.