TOKYO, Dec 30 (Reuters) - Japan's Nikkei index on Friday gave up early gains to end flat ahead of new year holidays, and posted its first yearly loss in four years.

The Nikkei closed flat at 26,094.50, after rising as much as 0.9% earlier in the session driven by overnight gains on Wall Street. The index dropped 9.4% for the year, its first loss since 2018.

The broader Topix reversed course to end 0.19% lower at 1,891.71, falling 5% for the year, its first loss in four years as well.

"Investors are worried there may be something happening in the U.S. during the holiday. There are many uncertainties in overseas markets," said Shoichi Arisawa, general manager of the investment research department at IwaiCosmo Securities.

Japanese market will reopen on Wednesday after new year holidays.

Fast Retailing, the owner of Uniqlo clothing brand, rose 1.94% and technology investor SoftBank Group gained 0.46%.

Shipping firms rose 1.23% and were the best performers among the 33 industry sub-indexes on the Tokyo bourse.

Staffing agency Recruit Holdings fell 1.56%. Drug maker Chugai Pharmaceutical fell 1.00%.

Oil explorers dropped 1.33% and were the worst performers among the sub-indexes. Refiners fell 1.02%.

Of the Nikkei components, 91 stocks rose and 121 declined, while 13 were flat.

The volume of shares traded on the Tokyo bourse's main board was 0.9 billion, compared to the average of 1.19 billion in the past 30 days. (Reporting by Junko Fujita; Editing by Krishna Chandra Eluri and Vinay Dwivedi)