DETROIT — Hyundai and Kia are recalling more than a half-million compact cars in the U.S. because the brake lights may not go out when the pedal is released.

The recall covers more than 390,000 Hyundai Elantra vehicles from the 2013 and 2014. Also included are over 134,000 Kia Forte cars from 2012 through 2014.

The companies say in documents filed with the government that a polymer stopper pad between the pedal arm and the light switch can deteriorate, allowing the switch to stay on. That can keep the brake lights illuminated and also let a driver shift out of park without putting a foot on the brake.