GM registering for IPO tomorrow?

General Motors is said to have secured a $5 billion credit facility and plans to file a registration for its initial public offering tomorrow, a stunning turnaround for the top U.S. automaker a year after it emerged from bankruptcy.

GM's second-quarter earnings come out on Friday and analysts expect it to post its second consecutive quarterly profit, helped by improved profitability and global auto sales.

GM is now 61 percent owned by the U.S. government. Securing the bank credit means it is on its way to make the government a minority shareholder and give Obama a nice boost against critics of GM's $50 billion government bailout.

GM's IPO would be the largest ever for the U.S. market and is expected before Thanksgiving in November. GM is expected to seek to raise $12 billion to $16 billion in the IPO.