DETROIT – After years of big discounts, GM is charging customers more for its cars and trucks, and it’s helping the bottom line.

General Motors Co. said Thursday its second-quarter profit nearly doubled to $2.5 billion. Higher pricing — mostly in North America — added $1 billion to its results. Revenue rose 19 percent.

Despite the good news, GM’s stock faltered as the market saw its worst drop in three years. Investors fretted about the economic outlook and GM’s admission that the second half won’t be as strong as the first. GM shares fell 4 percent to $25.99, their lowest closing price since its November public stock offering.

But the earnings show how far GM has come since the days before its 2009 bankruptcy, when it cranked out too many mediocre products and was forced to offer big discounts to clear them off the lots. GM has closed plants, shuttered brands and plowed the savings into making better vehicles.

The new Chevrolet Cruze, for example, was the best-selling car in the U.S. in June. Buyers are paying an average of $4,300 more for it than they paid for its predecessor, the lackluster Chevrolet Cobalt. The Cruze also sold well in China, where Chevrolet’s June sales rose 34 percent. Plush new entries like the Buick LaCrosse sedan and GMC Terrain crossover are also commanding higher prices.

GM can charge more because it’s making highly desirable vehicles, GM’s North American president, Mark Reuss, said Thursday at an industry conference in Michigan. And there are more in the pipeline. Reuss said GM will add two Cadillacs to its lineup next year, and the subcompact Chevrolet Sonic will go on sale soon.

GM’s numbers topped those at Chrysler and Ford, which struggled with the rising cost of raw materials such as steel. GM also paid more for materials but mitigated the losses with price increases. The company has raised the price of its vehicles three times this year, for a total of around $500 per vehicle, said Chief Financial Officer Dan Ammann.

But the price hikes haven’t dampened demand. GM’s sales rose 7 percent to 2.3 million cars and trucks, and the company gained market share in every region outside South America.

GM also spent millions less on rebates and other deals in the second quarter because of earthquake-related shortages at Toyota, Honda and other competitors. GM’s incentive spending per vehicle fell 20 percent to $3,022 in June, according to the car pricing site That was nearly $1,000 less than the company was spending in the same month six years ago, when it was overproducing vehicles and had to use big incentives to sell them.

That trend may not hold in the second half of the year, when Japanese inventories are restocked and competition will heat up. GM has vowed not to resort to discounts, but analysts aren’t so sure. The company ended June with four months’ worth of pickups to sell, for example, and may be forced to discount them in the coming months. A two- or three-month supply is more typical.

GM said it’s stocking up on pickups because it plans to temporarily close its truck factories next year to get them ready for new models. But Ammann conceded that the company’s second half performance will be “modestly lower” than in the first half, when it made $5.7 billion. GM is anticipating a seasonal drop in sales and the economy remains shaky.

GM’s results were being closely watched by the U.S. government, which still holds 500 million GM shares that it got as part of the company’s 2009 bailout package. The government needs $26.4 billion to recoup its full investment in GM, meaning GM’s shares would have to sell for roughly $53 per share.