General Motors engineers knew 10 years ago about a problem with ignition switches in some of its most popular models, but it took until this month to issue a recall. By that time, there had been at least 13 deaths as a result of the issue.

What took GM so long?

Documents submitted by GM (GM) to the National Traffic Highway Safety Administration show that the work of the automaker's own investigators was hampered by a series of internal miscues.

"The process employed to examine this phenomenon was not as robust as it should have been," GM North American President Alan Batey acknowledged in a statement released this week.

"We will take an unflinching look at what happened and apply lessons learned here to improve going forward," he said.

The recall was announced on February 13, and has been expanded to include almost 1.4 million vehicles in North America. Models affected include the Chevrolet Cobalt and HHR, Pontiac's G5 and Solstice, and Saturn's Sky and Ion.

The essential problem: The cars' ignition switch, where the key is inserted and turned to start the car, could easily be bumped or moved out of the "Run" position into the "Off" or "Accessory" position. When that happens, power braking and steering, as well as airbags, can stop working.

Related: GM accused of deadly recall delay

NHTSA has now opened a formal investigation to determine whether GM was too slow in dealing with this problem. Under federal rules, an automaker has 5 days from learning of a safety defect to report it to NHTSA. Automakers can be fined up to $35 million for violating that rule.

GM first learned of the problem in 2004 just as the all-new Cobalt was being released. One of GM's own engineers accidentally knocked his car out of "Run" while driving it, according to a deposition given as part of a personal injury lawsuit.

The automaker immediately opened an internal investigation. Various fixes were contemplated but, ultimately, nothing was done.

"After consideration of the lead time required, cost, and effectiveness of each of these solutions, the [investigation] was closed with no action," a GM report to NHTSA says.

But new complaints kept coming in about cars shutting off when the key or steering column was accidentally bumped. So there were more investigations.

In 2005, an engineer proposed that GM redesign the key, an idea that was approved but then dropped.

Instead, GM sent a bulletin to dealers that year asking them to inform customers about the problem. Customers were instructed to remove "unessential items from their key chain," the carmaker said. The added weight of decorations and other keys increased the chances the key could turn accidentally.

Additionally, GM engineers devised a key ring insert that was supposed to keep attachments on the key ring from moving around and pulling on the key.

The problem wasn't seen as terribly dangerous at the time, according the timeline GM filed with NHTSA. Even with the engine shut off, GM told the media in 2005, the steering and brakes still worked, although greater effort was needed. And the engine could be restarted after the car was shifted into "Neutral" or "Park."

But the problems with the switches didn't go away.

Related: GM recalls 778,000 cars for faulty ignition

By 2005, there was at least one death when front airbags failed to deploy. GM's legal department opened a file on the case, but nobody told the automaker's own safety engineers.

The engineers only found out about the death during a 2007 meeting with regulators at NHTSA.

After that meeting, a GM engineer was assigned to study all Chevrolet Cobalt crashes in which front airbags didn't deploy, looking for any common element in those crashes. Apparently, nothing was found.

In 2009, GM opened yet another investigation into the ignition problem. That study concluded that GM should redesign the key -- the idea that had been accepted and dropped years before. That change was implemented on 2010 cars, the last model year GM produced the Cobalt.

Related: Toyota recalls 2.1 million vehicles

Meanwhile, airbags still weren't deploying as they should in front end crashes of earlier models of the Cobalt and G5. As engineers pored over records, they realized that the ignition switch problem was only happening in cars made before 2007.

What most people at GM didn't know was that Delphi (DLPH), the company that supplied the switch, had redesigned the part in 2006 to make it harder to turn.

The problem had been fixed. A GM engineer even signed off on the changes. Unfortunately, GM didn't change the part number of the switch. As a result, manufacturing records didn't indicate that the issue had been resolved.

So other GM engineers kept looking for solutions. The company even hired an outside engineering firm that tore apart and x-rayed ignition switches from different model years. Those experts finally determined that the part on the earlier cars was different.

Finally, in October 2013, GM talked with Delphi, which produced papers showing that the GM engineer had signed off on changes to the ignition switch seven years earlier.

With the answer finally in hand, GM started the process that resulted in this month's recall of cars made between 2004 and 2007.

"We deeply regret the events that led to the recall and this investigation," GM said in a statement released Thursday.