TOKYO, Feb 2 (Reuters) - Japanese shares extended gains for a second consecutive session on Tuesday, recovering from last week's sharp sell-off, while growing optimism about corporate earnings both domestically and in the United States also boosted sentiment.

The Nikkei index rose 0.77% to 28,306.82 by 0155 GMT, with semiconductor-related shares and materials makers leading gains. The broader Topix rose 0.83% to 1,844.91.

Japanese stocks took their lead from an overnight jump in U.S. tech shares ahead of earnings from Amazon.com and Alphabet Inc later in the day.

In addition, many Japanese companies are reporting earnings this week, and some investors are betting that a gradual recovery in the global economy will lift profits.

Worries about a short-squeeze triggered by U.S. retail investors shook global markets last week, but volatile swings have abated this week, which makes it easier for bullish investors to buy shares and other riskier assets.

"U.S. markets are starting to settle down, so we can turn our attention back to earnings and fundamentals," said Takashi Nishizawa, head of research at Nomura Securities.

"The U.S. economy is on a stable footing. There's optimism about earnings for the U.S. tech sector and Japanese manufacturers."

Leading gains on Topix, Sony Corp jumped 3.15%, followed by Murata Manufacturing Co surging 3.02%.

Top decliners were Keyence Corp and Hoya Corp falling 1.94% and 1.40%, respectively.

The Japanese government is expected to extend a state of emergency for Tokyo and surrounding cities later in the day to curb a spike in coronavirus infections, but investors shrugged this off as they focused on earnings outlook.

There were 165 advancers on the Nikkei index, against 56 decliners.

The volume of shares traded on the Tokyo Stock Exchange's main board was 0.45 billion, compared to the last 30-day average of 1.16 billion.

(Reporting by Stanley White; Editing by Rashmi Aich)