General Motors Co. said Friday that its general counsel, and one of GM CEO Mary Barra’s closest advisers, has chosen to retire early next year.

The Detroit automaker said it immediately will begin an external search to replace Michael Millikin, who has held the top legal job at GM since 2009. He holds a key position in GM’s executive team as the company continues to face legal challenges and investigations in wake of its ignition switch recall crisis this year. GM faces investigations by Justice Department, 45 state attorney general’s offices and the U.S. Securities and Exchange Commission.

In July, GM CEO Mary Barra stood by the company’s top lawyer, saying she had no plans to fire him after he was harshly criticized by a Senate panel investigating GM’s delayed ignition switch recall.

“Mike has had a tremendous career, spanning more than 40 years, with the vast majority of it at GM,” Barra said in a statement issued Friday. “He has led global legal teams through incredibly complex transactions, been a trusted and respected confidant to senior management, and even led the company’s global business response team following the tragedy of 9/11.

“For me personally, Mike has been incredibly helpful over the past two decades. I find him a man of impeccable integrity, respectful candor, and unwavering loyalty. He will be missed. I wish him and his wife, Karen, much happiness in this next chapter of their lives.”

Millikin, 66, will remain in his position until a new general counsel is in place, the company said.

Several employees from GM’s legal department were among those Barra fired following results of GM’s internal investigation into why it took more than a decade to recall nearly 2.6 million older Chevrolet Cobalts, Saturn Ions and older cars for faulty ignition switches. The bad switches have now been tied to 27 deaths.

Barra and Millkin were cleared of any wrongdoing in the investigation, but at least four GM lawyers were fired of 15 whom Barra terminated. The report showed GM lawyers were allowed to settle lawsuits without notifying Millikin. GM said in July it had retained an outside law firm to review how it responds to lawsuits and other legal matters.

Earlier this year, during the fourth Congressional hearing into GM’s ignition switch recall, Barra strongly defended Millikin. Millikin said he didn’t learn until early February of the ignition switch problem, even though the legal department was warned of a potential problem in a lawsuit dating back to April 2013.

“How in the world in the aftermath of (the GM internal) report did Michael Millikin keep his job? This is either gross negligence or gross incompetence on the part of a lawyer,” Sen. Claire McCaskill, D-Mo., said at the time. She headed the Senate Commerce panel hearing testimony from Barra, Millikin, Delphi Automotive CEO Rodney O’Neal, compensation adviser Ken Feinberg and Anton Valukas, the outside attorney who led GM’s internal investigation.

GM’s culture of “lawyering up … killed innocent customers of General Motors,” McCaskill added. “I think the failure of this legal department is stunning.”

Barra said she “respectfully” disagreed, and defended Millikin as a man of “incredibly high integrity.” “I need the right team,” Barra said. “He’s the person I need on this team.”

Some people have said to change GM’s culture, it needs new blood, including in the legal department.

U.S. Sen. Richard Blumenthal (D-Conn.), back in the July Senate hearing, said Millikin should resign.

“With Mr. Millikin’s retirement, GM has an opportunity to bring in fresh leadership and sever another tie to the Old GM,” Blumenthal said in a statement Friday.

GM Chairman Tim Solso, in a statement, said the board wishes Millkin well in his retirement.

“Mike has served the Board extremely well,” Solso said in a statement. “He has been a valued adviser, a strong leader and a consistent and honest voice over the past several years.”

Millikin served as an Assistant United States Attorney in Detroit, concentrating on the prosecution of drug and drug conspiracy cases before joining in GM in 1977. With the automaker, Millikin held a number of legal positions for the company, including heading in-house litigation in 1987 where he led the company’s response to theft of confidential data and documents by Jose Ignacio Lopez and others. He also served on the strategy board for GM’s International Operations and was named to the Opel Supervisory Board in the late 1990s.

The U.S. Attorney’s Office in New York — aided by a federal grand jury and the FBI — is investigating whether GM lawyers misled the National Highway Traffic Safety Administration in its investigation into the ignition switches, among other issues under review by the Justice Department.

The recall of the cars was delayed more than a decade after some in the company became aware of the problem. Ignition switches in Cobalts, Ions and other older cars turn too easily and can allow the key to shut off the engine inadvertently in a crash or when bumped. That can disable power steering and power brakes, creating control problems. And in a front-end crash, air bags won’t inflate.

mburden@detroitnews.com

(313) 222-2319

Twitter.com/MBurden_DN