PEARL HARBOR, Hawaii (Reuters) - Japanese Prime Minister Shinzo Abe made a symbolic visit to Pearl Harbor with President Barack Obama on Tuesday, commemorating the victims of Japan’s World War Two attack and promising that his country would never wage war again.

The visit, just weeks before Republican President-elect Donald Trump takes office, was meant to highlight the strength of the U.S.-Japan alliance amid concerns that Trump could forge a more complicated relationship with Tokyo.

“I offer my sincere and everlasting condolences to the souls of those who lost their lives here, as well as to the spirits of all the brave men and women whose lives were taken by a war that commenced in this very place,” Abe said.

“We must never repeat the horrors of war again. This is the solemn vow we, the people of Japan, have taken.”

Japanese forces attacked Pearl Harbor with torpedo planes, bombers and fighter planes on the morning of Dec. 7, 1941, pounding the U.S. fleet moored there in the hope of destroying U.S. power in the Pacific.

Abe did not apologize for the attack, a step that would have irked his conservative supporters, many of whom say U.S. economic sanctions forced Japan to open hostilities.

“This visit to Pearl Harbor was to console the souls of the war dead, not to apologize,” Chief Cabinet Secretary Yoshihide Suga told a news conference in Tokyo, adding the trip had showed that the allies would contribute to world peace and prosperity.

Obama, who earlier this year became the first incumbent U.S. president to visit Hiroshima, where the United States dropped an atomic bomb in 1945, called Abe’s visit a “historic gesture” that was “a reminder that even the deepest wounds of war can give way to friendship and a lasting peace.”

Abe became the first Japanese prime minister to visit the USS Arizona Memorial, built over the remains of the sunken battleship USS Arizona, although three others including his grandfather had made quiet stops in Pearl Harbor in the 1950s.

The two leaders stood solemnly in front of a wall inscribed with the names of those who died in the 1941 attack and took part in a brief wreath-laying ceremony, followed by a moment of silence.

“In Remembrance, Shinzo Abe, Prime Minister of Japan” was written on one wreath and “In Remembrance, Barack Obama, President of the United States” on the other.

They then threw flower petals into the water.

After their remarks, both leaders greeted and Abe embraced U.S. veterans who survived the Pearl Harbor attack.

Slideshow ( 11 images )

In China, which has repeatedly urged Japan to show greater repentance for World War Two and Japan’s invasion of China, Foreign Ministry spokeswoman Hua Chunying said real reflection was needed, not show.

“Reconciliation between inflictor and victim must and can only be established on the basis of sincere and deep reflection by the inflictor,” Hua told a daily news briefing.

Slideshow ( 11 images )

DISPLAY OF ALLIANCE STRENGTH

Japan hopes to present a strong alliance with the United States amid concerns about China’s expanding military capability.

During a meeting ahead of the Pearl Harbor visit, Abe and Obama agreed to closely monitor moves by China’s aircraft carrier, recently spotted on a routine drill in the Western Pacific for the first time, and to strengthen the U.S.-Japan alliance, Japan’s Kyodo news agency reported.

The leaders’ get-together was also meant to reinforce the U.S.-Japan partnership ahead of the Jan. 20 inauguration of Trump, whose opposition to the Trans-Pacific Partnership trade pact and campaign threat to force allied countries to pay more to host U.S. forces raised concerns among allies such as Japan.

Obama has sought to provide a smooth transition for Trump, but he made his opposition to the Republican’s policies, including his proposal to ban Muslims temporarily from entering the United States, clear during the 2016 campaign.

“It is here that we remember that even when hatred burns hottest, even when the tug of tribalism is at its most primal, we must resist the urge to turn inward,” Obama said at Pearl Harbor. “We must resist the urge to demonize those who are different.”

Abe met with Trump in New York in November and called him a “trustworthy leader.”

Obama called for a world without nuclear arms during his visit to Hiroshima. Trump last week called for the United States to “greatly strengthen and expand” its nuclear capability and reportedly welcomed an international arms race.

Some Abe critics noted the Japanese leader’s visit, and the reconciliation with the United States that it symbolized, underscored the stark contrast in its relationship with China and South Korea, where the bitter wartime legacy still plagues ties with Tokyo.

Abe’s cabinet minister for reconstruction of disaster-hit regions, Masahiro Imamura, paid his respects later in the day (Wednesday, Tokyo time) at Tokyo’s Yasukuni Shrine for war dead, seen in China and South Korea as a symbol of Japan’s past militarism, Kyodo news agency said. Abe angered Beijing and Seoul and upset Washington with his own visit to the shrine three years ago this month.

“A symbolic gesture of contrition to your closest ally is easy,” said Jeffrey Kingston, director of Asian studies at Temple University’s Japan campus in Tokyo.

“If he (Abe) really is sincere about reconciliation diplomacy and overcoming lingering enmities he needs to visit similar symbolic sights (in China and Korea) ... and make similar remarks of remorse that are more specific about Japan’s responsibility.”