Hyundai Motor posted a 37 percent gain in quarterly net profit on Thursday, outstripping the consensus forecast, after it logged record global vehicle sales and gained market share from Japanese rivals reeling from the March 11 earthquake.

After posting a series of strong profits, the South Korean carmaker must manage investor expectations as Japanese rivals recover faster than expected and the won firms.

Debt problems in the United States and Europe also threaten to slow the auto market recovery in those regions, while growth in China shows signs of cooling.

Hyundai, the world's fifth-biggest carmaker along with affiliate Kia Motors, on Thursday reported a 2.3 trillion won ($2.2 billion) net profit for the April to June quarter, compared with a consensus forecast of 2.1 trillion won from Thomson Reuters I/B/E/S.

That was up from a 1.7 trillion won net profit a year ago and from 1.9 trillion won in the first quarter.

From this year, Hyundai has been reporting earnings on a consolidated basis to reflect the earnings of its affiliates, including financial operations, under new accounting rules.

Hyundai said its global car sales rose 13 percent to a record 1,039,088 vehicles in the second quarter from a year earlier.

Hyundai said its market share in the United States jumped to 5.5 percent in the second quarter from 4.7 percent a year earlier, driven by strong sales of its Sonata sedan and Elantra compact, while its Japanese rivals suffered from production disruptions.

On June 30, Hyundai raised its U.S. sales target by 6 percent to 624,000 vehicles for this year.

Hyundai also gained traction in its home market, helped by brisk sales of the new Grandeur large sedan.

Shares in Hyundai Motor have jumped 40 percent this year, outperforming the wider market's 6 percent gain. The stock fell 0.8 percent after the results, versus a 1 percent drop in the KOSPI. ($1 = 1050.000 Korean Won)

(Reporting by Hyunjoo Jin; Editing by Matt Driskill and Jonathan Hopfner)