DETROIT (Reuters) - General Motors Co Chief Executive Ed Whitacre resigned on Thursday in an abrupt move that renewed questions about leadership at the automaker as it readied a stock offering critical to paying back its controversial U.S. government bailout.

General Motors Company Chairman of the Board Edward E. Whitacre Jr. addresses the media during a news conference at the GM headquarters in Detroit, Michigan in this July 10, 2009 file photo. REUTERS/Rebecca Cook/Files

Dan Akerson, 61, a veteran private equity investor little known in auto circles, replaces Whitacre, 68, as of September. Akerson had been appointed by the Obama administration as one of the directors meant to safeguard the government’s $50 billion financing to restructure GM.

Whitacre’s departure had been expected, but the timing of his announcement caught even GM insiders off guard, just a day before GM was expected to file the paperwork for a landmark stock offering that would mark its reemergence as a publicly traded company a year after bankruptcy.

Whitacre, who continued to commute from his home in Texas during his stint as CEO of the Detroit-based company, had said repeatedly he would be an interim leader.

“It was obvious that I was not going to be at GM for the long haul,” Whitacre said in surprise remarks at the end of a conference call to discuss the company’s second-quarter earnings. “We have put a strong foundation in place, so I am very comfortable with my timing.”

Jeffrey Sonnenfeld, a management expert at the Yale School of Management, said Whitacre was having a positive impact at GM and should have stayed on under normal circumstances.

“The instability certainly is a shock to insiders; it’s stunning to outsiders and you don’t usually have that happen,” Sonnenfeld said. “There is a story here that we are not getting. Clearly this was not part of a planned succession.”

A former AT&T Inc chief executive, Whitacre had been expected to stay on at GM through the filing of the IPO. As recently as last week, he described plans for a series of meetings with big investors to tout the offering.

The sudden management change could delay GM’s planned IPO filing on Friday by a few days, sources with knowledge of the process said.

The U.S. Treasury said GM’s board made the decision, which did not require government approval.

South Beach Capital Markets Advisory Corp President Bruce Foerster said the shakeup at the top of GM risked spooking investors and causing them to add a new risk premium to the upcoming stock offering.

“You needed the sun, moon and stars all aligned and now they’re out of whack again,” said Foerster, formerly head of equity capital markets at PaineWebber and the head of global equity syndicate at Lehman Brothers.

Akerson, also a former CEO at Nextel, will become GM’s fourth chief executive in just a year and a half, underscoring the challenge in remaking the corporate culture of an automaker still in the early stages of a turnaround.

A managing director of The Carlyle Group for the past seven years, Akerson spearheaded some of the private equity firm’s biggest recent deals, including the buyout of energy company Kinder Morgan.

His appointment as GM CEO thrusts an executive known for quiet deal making into the spotlight as salesman in chief for the top U.S. automaker.

BIGGEST PROFIT IN SIX YEARS

Separately, GM posted a second-quarter profit of $1.3 billion as evidence of a turnaround driven by cost-cutting in its 2009 bankruptcy and better sales in the United States.

The second-quarter profit was the largest since 2004, when the U.S. auto market was still booming with annual sales of near 17 million vehicles and GM’s brands accounted for more than one in four purchases of new cars and trucks.

GM’s results show it is trailing its more successful and smaller rival, Ford Motor Co, which posted a second-quarter profit of $2.6 billion, but that it is ahead of Chrysler, which lost $172 million.

But analysts expect the company to use the results to build the case for a record stock offering and allow the U.S. government to reduce its 61 percent ownership stake.

A successful GM IPO would provide the Obama administration with evidence the unprecedented and unpopular intervention in the U.S. auto industry has been a financial success.

Europe, where GM is still struggling to restructure its Opel unit, remained a notable weak link for the automaker, with an operating loss of $160 million.

North America had an operating profit of $1.6 billion. International operations, including GM’s China joint ventures with SAIC and Wuling, had an operating profit of $672 million.

GM lost about $88 billion between 2005 and 2009 when it was driven into bankruptcy by plunging sales and tight credit.

Sources told Reuters on Wednesday the largest U.S. automaker had secured a $5 billion credit facility, marking its return to the capital markets a year after it emerged from a government-funded landmark bankruptcy.

Chief Financial Officer Chris Liddell declined to comment in detail when asked about the credit facility. He said the arrangement was “one of the building blocks” GM needed to restore its balance sheet.