DETROIT — General Motors Co. said Thursday it made $1.33 billion in the second quarter, a sign it's getting healthier as it prepares to sell stock to the public.

It was the second straight quarterly profit for GM, which made $865 million in the first quarter.

CEO Ed Whitacre said last week that the company is eager to sell shares in an initial public offering so it can end its dependence on the government and pay off $43.3 billion in bailout funds that were converted into a majority stake in the company.

Whitacre said the company plans to file paperwork in the near future for the IPO. But it's unclear if the recent record of profits — $2.2 billion for the first half of 2010 — is enough to convince investors. GM lost $88 billion in the five years before it filed for bankruptcy protection last June.

GM's second-quarter revenue totaled $33.2 billion, up 5.3 percent from the first quarter on growing sales in every region except Europe. In the U.S., GM saw strong sales of new and redesigned models like the Chevrolet Equinox wagon and Buick LaCrosse sedan.

GM said it earned $2.55 per share for the quarter. GM didn't report second-quarter results last year because it spent part of the quarter in bankruptcy protection, but on Thursday, GM said it lost $12.9 billion in the second quarter of 2009, or $21.12 per share.

So far, GM's results are a reversal of fortune from 2009, when it lost $4.3 billion from July 10, the day it exited bankruptcy court, through Dec. 31. Before the first-quarter results, GM hadn't reported a profit since the second quarter of 2007.

GM said it ended the quarter with $32.5 billion in cash, down from $36 billion in the first quarter.

GM has been working to streamline operations and slash costs. It has shed four brands, changed leadership and last week announced its U.S. dealership network would number 4,500, about 25 percent smaller than it was in early 2009.

But it still faces hurdles. GM's U.S. sales rose 14 percent in the first six months of this year compared to the same period in 2009, according to AutoData Corp. That was slightly less than the average industry increase of 17 percent. GM had the highest incentive spending of any major automaker at $3,691 per vehicle, almost $1,000 more than the industry average, according to Edmunds.com.

GM has also relied heavily on sales to rental-car, government and corporate fleets, which are less profitable than sales to individual customers. Retail sales — or sales to individuals — were up 11 percent industry wide through June, but up only 1 percent at GM.

GM is the last of the Detroit automakers to report second-quarter results. Ford Motor Co. made $2.6 billion, its fifth straight quarterly profit. Chrysler Group LLC, which got $15.5 billion in federal aid, narrowed its second-quarter loss to $172 million.

The U.S. government has owned a 61 percent stake in GM since the company left bankruptcy protection.

"We want the government out. Period," Whitacre said during an auto conference in northern Michigan. "We don't want to be known as Government Motors."

GM has already paid $6.7 billion in government loans. Whitacre said GM wants to sell its stock all at once, rather than in batches, which would end the government's ownership more quickly.

But the U.S. government and GM's other stakeholders — a United Auto Workers health-care trust, which owns 17.5 percent of the company; the Canadian government, which owns 11.7 percent; and old bondholders, who own 9.8 percent — will ultimately decide how much of their equity to sell.

A GM IPO could be the largest such sale in U.S. history. It would have to bring in $70 billion to pay back all of GM's stakeholders; some analysts expect the IPO will be worth at least than much. That would be more than Ford's market value of roughly $44 billion, but less than the total value of Toyota's shares of about $113 billion.

It would also dwarf a 2008 offering by Visa Inc. that netted nearly $18 billion.

GM is taking steps to boost its U.S. sales. In July the company said it would buy AmeriCredit Corp., an automotive financing company that serves the subprime market, for $3.5 billion. Though it was partners with Ally Financial Inc., formerly known as GMAC, GM previously lacked a so-called captive financing company, which can offer better rates to customers than outside financial sources.

GM also has several new vehicles in the pipeline. Its new Chevrolet Cruze, due out next month, is GM's latest bid to make a desirable — and profitable — small car. Later this year, the company will begin selling the Chevrolet Volt, a $41,000 electric car with a small gas engine that extends its range.