Hu, on a five-day visit aimed at bolstering revived ties with Japan, has focused consistently on the positive in his stay so far, calling for closer cooperation in business, the environment and regional development.

The president’s comments at the elite Waseda University on the wartime past were crucial, as Beijing has often accused Tokyo of failing to properly atone for its military conquests on the Asian mainland in the 1930s and 1940s.

In his 30-minute address, Hu mentioned Japan’s “militaristic invasion of China,” but that it should not be dwelled upon.

“This unfortunate history not only caused tremendous suffering to the Chinese people, but also gravely hurt the Japanese people,” he said. “It’s important for us to remember history, but this does not mean we should hold grudges.”

Hu also pledged that his country would never become a military threat.

Both Japan and the US have repeatedly voiced concerns about China’s military spending, which has grown by double digits every year for two decades.

“China will take defensive military policy and will not join any arms race,” Hu said.

“We will not become a military threat to any country and we will never assert hegemony or be expansionistic,” he said.

In rare public remarks for a Chinese leader that triggered roaring applause, Hu thanked Japan for its years of low-interest loans, saying they helped his country to develop.

“We have achieved unprecedentedly large growth, but we are also aware that we are the world’s biggest developing country,” Hu said. “We have a long way to go to build a greater society for more than 1 billion people and to achieve affluence for all people of the nation. We have to continue to make efforts patiently.”

Hu stressed China would maintain its “open-door” policy to foreign investment but would “continue to move ahead with our ideology of socialism with Chinese characteristics.”

As Hu spoke, protests thundered outside. Hundreds of riot police circled the venue, keeping chanting demonstrators about 100m away. Minor scuffles broke out and several protesters were seen being led away by officers.

While the trip was aimed at bolstering warm feelings between Japan and China, Hu has been dogged by reminders of the international criticism of Beijing’s handling to March protests in Tibet.

Before his speech at Waseda, a right-leaning alumni group demanded that it be canceled, calling him “the chief executive of oppression over the right to ethnic self-determination and human rights of the Tibetans” in a statement signed by several dozen alumni.

A breakfast meeting with former Japanese prime ministers was also not entirely free of signs of tension. Missing from the attendance list was former Japanese prime minister Junichiro Koizumi, who strained ties repeatedly with Beijing by visiting Yasukuni shrine, which many see as a symbol of Japan’s militarist past, during his 2001-2006 tenure in office.