TSMC, whose clients include iPhone maker Apple Inc, said July-September profit was T$89.07 billion ($2.9 billion). That compared with the T$89.0 billion average forecast drawn from 23 analysts, according to Refinitiv data.

Revenue rose 1.9 percent to $8.49 billion, compared with the company's own estimate of $8.28 billion-$8.38 billion and the average $8.4 billion estimate of 25 analysts, according to Refinitiv data.

The results come weeks after rival GlobalFoundries announced that it would not compete in the latest generation of chip-making technology, a move analysts said will further consolidate TSMC's technological leadership advantage.

And semiconductor industry bellwether ASML Holding, a supplier to TSMC, posted better-than-expected third quarter results and gave a bullish outlook on Wednesday, helping assuage fears of slackening demand.

But an intensifying trade spat between the United States and China could also be a near-term risk for TSMC, whose semiconductors are widely used in electronics devices made in China.

KGI analyst Benjamin Chiang said in a report prior to the results in early October that near-term demand for products such as servers will be affected by the trade spat, but TSMC's leading position in foundries could help it partially offset that.

Analysts said solid demand for Apple's new iPhone models, estimated from contract electronics maker Foxconn's revenues for September, will also support TSMC's growth in the fourth quarter, a crucial year-end holiday season for smartphone makers.

Shares of TSMC, which rivals Intel Corp as the world's biggest semiconductor firm by market value, closed down 0.8 percent at T$236.50 on Thursday ahead of the financial results, compared with a 0.3 percent fall for the benchmark index <.TWII>.

($1 = 30.9330 Taiwan dollars)

(Reporting By Jess Macy Yu and Yimou Lee; Editing by Muralikumar Anantharaman)