The recall affects Chevrolet Cobalts and Pontiac G5s from the 2005 through 2007 model years.
U.S. safety regulators say the weight of the key ring and rough roads can move the ignition switch out of the run position, cutting the engine and electricity. If that happens, air bags may not work.
GM says there have been 22 crashes from the problem. All were off the road and happened at high speeds.
Dealers will replace the ignition switch for free. GM says owners should remove nonessential items from key rings until the problem is fixed.