TAIPEI, Jan 19 (Reuters) - Taipei-listed shares of Taiwanese chipmaker TSMC soared on Friday after the company gave a bullish outlook for the year on the back of the boom in artificial intelligence (AI), cheering tech stocks at home and abroad.

Taiwan Semiconductor Manufacturing Co Ltd (TSMC), the world's largest contract chipmaker and a major Apple Inc and Nvidia supplier, on Thursday projected more than 20% growth in 2024 revenue on booming demand for high-end chips used in AI.

TSMC's shares rose as much as 6% on Friday in Taipei, after its' U.S. listed stocks closed up almost 10% overnight, with the S&P 500 approaching record highs as AI optimism drove gains in Nvidia and other chipmakers.

The outlook also boosted the broader Taipei market, which rose 2%, as well as other Taiwanese tech firms.

AI server makers Quanta and Wistron's stocks jumped too. Quanta rose around 8%, while Wistron leapt some 9%.

TSMC's announcement that it was evaluating building a third fab in southern Taiwan's Kaohsiung city to produce advanced 2 nanometre chips also gave a boost to the government.

Opposition politicians have repeatedly criticised the government for allowing TSMC to build fabs overseas and "hollow out" the sector, and have said some investors believe Taiwan is a risky place to expand production given tensions with China.

Economy Minister Wang Mei-hua told reporters on Friday TSMC's domestic expansion plans showed the fallacy of such claims. "Investment in Taiwan will definitely increase," she said.

Both TSMC and the government have repeatedly said the most advanced chips will continue to be produced in Taiwan.

Kaohsiung Mayor Chen Chi-mai said the city had been working hard to ensure stable and reliable water and power supplies for TSMC's factories.

"Its key strategy is still to focus on Taiwan," he told reporters.

TSMC is such an important company for Taiwan's trade-dependent economy it is widely referred to as "the sacred mountain protecting the country". (Reporting by Ben Blanchard; Editing by Tom Hogue and Miral Fahmy)