The company's second quarter net profit was up 80.8 percent

HTC posted a year-over-year gain in net profit for the second quarter, following the release of the company's latest flagship phone, and new low-end handsets coming to China.

During the period, HTC's net profit reached NT$2.26 billion (US$75.6 million), up 80.8 percent from a year earlier. The company's quarterly revenue, however, barely met HTC's outlook for the period, and reached NT$65.06 billion, down 8 percent year on year.

The company's latest flagship phone, the HTC One M8 went on sale in late March, with a wider global roll out in April. The phone has been performing well, outselling last year's model, the company's CFO said in May.

It's a positive sign for a company that's been facing fierce competition from Apple and Samsung Electronics. Once the biggest Android smartphone vendor in the U.S., HTC's market share and earnings have both taken a dive. HTC reported a net loss of NT$1.88 billion in the first quarter, and posted another loss of NT$3 billion in last year's third quarter.

To correct course, the Taiwanese company has been ramping up its marketing, hiring celebrities Robert Downey Jr. and Gary Oldman to star in its advertisements. It has also embarked on cutting down production costs, and introducing a range of lower-end phones to regain market share.

Some of those phones have been built for the neighboring Chinese market. In October, the company said it wanted China to become like its "home market."

But even with the recent rebound in profit, HTC's earnings are still far below what they were two years ago. Back then, the company reported NT$7.9 billion in net profit for 2012's second quarter. Doubts also remain about whether the company can mount a sustained comeback. Phones from Apple and Samsung continue to lead the market, and rising vendors from China, including Huawei Technologies, Lenovo and Xiaomi are working to expand globally.