DETROIT (AP) -

General Motors is recalling nearly 780,000 older-model compact cars in North America. It says a faulty ignition switch can shut of the cars' engines without warning and cause crashes. GM says six people have been killed in 22 crashes related to the problem. All were at high speeds. The recall affects Chevrolet Cobalts from the 2005 through 2007 model years and Pontiac G5s from 2007.

General Motors is recalling nearly 780,000 compact cars in North America because the engines can shut down unexpectedly and cause crashes. The company says six people have been killed in crashes related to the problem.

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.