TOKYO : Japanese Prime Minister Shinzo Abe shook hands with Chinese Premier Li Keqiang in Milan Friday, reports said, despite a mass visit by Japanese lawmakers to a controversial war shrine in Tokyo.

The brief greeting and exchange of pleasantries, reported by Japanese press citing an official travelling with Abe, was the first time the two men have met, and comes as Japan continues to press for a summit with President Xi Jinping next month.

It is the latest sign of a gathering thaw in relations that have been in deep freeze for two years, since Tokyo and Beijing fell out over the ownership of disputed islands and their differing interpretations of history. The meeting took place despite anger in Beijing over an offering made in Abe’s name at Yasukuni Shrine, a spot reviled by China and South Korea as a symbol of Japan’s militarist past, and as a cross party group of 110 parliamentarians paid homage there.

The visit was made to mark the start of the shrine’s four-day autumn festival. Abe, who sent a votive tree with his name and title prominently displayed, is thought unlikely to go even after he returns home Saturday from an Asia-Europe summit in Italy.

His visit in December last year infuriated Beijing and Seoul, who say the inclusion of senior war criminals among those honoured by the shrine makes it an insult to the grievous injuries Tokyo inflicted up to and during World War II.

China reacted with renewed anger on Friday. “China is gravely concerned and firmly opposes the negative activities in Japan surrounding the Yasukuni Shrine,” foreign ministry spokesman Hong Lei said in a statement.

“China would like to reiterate that Sino-Japan relations can only realise healthy and stable development when Japan seriously faces up to and repents of its aggressive past and disassociates itself with militarism,” he added.

South Korea called the move “deplorable” and said it showed Japan was “ignoring voices of the international community”.

Taiwan, a Japanese colony until 1945, also offered a rebuke, saying visits hurt “people’s feelings in neighbouring countries”.

The 145-year-old Shinto shrine is the supposed repository of the souls of some 2.5 million citizens and soldiers who died in World War II and other conflicts.

They include senior figures in the WWII administration, such as General Hideki Tojo, who ordered the attack on Pearl Harbor.

Japanese nationalist politicians who go to the shrine feign innocence and claim there is nothing wrong with honouring war dead.

Hidehisa Otsuji, who led the group of lawmakers Friday, said it was only “natural” that they visit the shrine to offer gratitude to the people who sacrificed their lives for the nation.

“People in any country pay homage to those who died for the sake of their countries,” he told reporters at the shrine.

The group went to Yasukuni during its spring and autumn festivals as well as on the August 15 anniversary of Japan’s surrender in World War II.

Every visit provokes a predictable reaction from neighbouring countries, although this is somewhat muted if senior administration figures stay away.

No ministers in Abe’s current government were seen at the shrine Friday, although health, labour and welfare minister Yasuhisa Shiozaki sent a tree offering, like Abe.

Japan’s top government spokesman Yoshihide Suga declined to comment on the prime minister’s offering, saying it was done in his capacity as “a private citizen”.

Suga also said Abe and his cabinet would make their decisions on visiting the shrine independent of any other considerations, and insisted the ministerial no-show was not linked to to an upcoming international meeting in Beijing.

The prime minister is pushing for a summit with President Xi on the sidelines of APEC next month. The two have not met during their time in power.

He stayed away from Yasukuni this year, although he made offerings for the spring festival and on the war anniversary on August 15.

His visit in December 2013 drew not only anger from neighbours, but a diplomatic ticking off from the United States, a key ally, which said it was “disappointed” by the decision.