DETROIT - At least six people have died because of accidents involving faulty ignition switches in General Motors compacts, prompting the big automaker to recall 778,562 of its 2005-2007 Chevrolet Cobalt and 2007 Pontiac G5 compacts.

GM said it knows of at least 22 accidents involving the ignition switches.

The nearly identical Cobalt and G5 were discontinued years ago but still can be found on used-car lots as cheap starter cars for low-budget shoppers.

The recall is an enormous black eye for GM, just as it regains its footing and is rebuilding its image because the government no longer owns any of its stock and its new CEO is the first woman to head a big automaker.

The ignition switches wear over time and heavy key rings, loaded with other keys and keepsakes, can pull the switch mechanism out of contact, causing the cars to stall and, in some cases, preventing the airbags from deploying.

There's no reason to think other automakers can escape the problem, unless the GM switches came from the supplier as faulty units at the time.

The recall is extraordinary. Flaws that cause automakers to recall vehicles almost never kill people. In fact, there are many recalls in which no accidents or injuries are reported, and the recall is because the car company noticed a flaw by monitoring reports from dealers and complaints from owners.

Toyota's "sudden acceleration" recalls involved fatalities, but NHTSA later determined that most cases involved driver error, or that the accelerator pedal got stuck open because incorrect floor mats were installed, able to trap the gas pedal in a wide-open position.

The infamous Ford Explorer/Firestone tire rollover cases killed a number of people due to flaws in the tires and in Ford's recommended tire pressures. Firestone recalled millions of tires and Ford replaced millions more Firestone on Explorers, to be sure the problem was solved.

GM told the National Highway Traffic Safety Administration that the ignition switch can fail when a key ring is "carrying added weight, or the vehicle goes off road, or experiences some other jarring event." In those cases, the switch could be "moved out of the 'run' position."

Adding to the safety risk in case of a crash, the timing of the key movement could result in the air bags not going off.

Making the GM situation more tragic is that the problem of heavy key rings has been known at least since the 1960s. Popular Science magazine's popular fix-it column featured Gus Wilson, proprietor of the Model Garage, tackling baffling problems. He solved a customer's engine stalling by taking most of the keys off her ring.

The weight of the extra keys pulled the ignition key out of position so it didn't make contact and the engine shut off.

GM told Reuters that it knows of five front-impact crashes and six fatalities in crashes where the front airbags did not deploy, though it said all were high-speed crashes where the probability of serious or fatal injuries was high in any case. It also said that alcohol use and not wearing seat belts figured in some of the cases.

Dealers will replace the ignition switch to remedy the problem, according to NHTSA, and GM urges owners to take non-essential items off of their key ring until the switch is replaced.