PEARL HARBOR, Hawaii (Reuters) - Japanese Prime Minister Shinzo Abe joined U.S. President Barack Obama for a symbolic joint visit to Pearl Harbor on Tuesday, commemorating World War Two dead and pledging that Japan 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 in the face of a rising China and amid concerns that Trump would have a more complicated relationship with Tokyo.

Abe and Obama commemorated the dead at the USS Arizona Memorial, built over the remains of the sunken battleship. Abe became the first Japanese prime minister to visit the memorial, a centerpiece of the historic site.

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

“To the souls of the servicemen who lie in eternal rest aboard the USS Arizona, to the American people, and to all the peoples around the world, I pledge that unwavering vow here as the prime minister of Japan,” he said.

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.

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.”

The two leaders stood solemnly in front of a wall inscribed with the names of those who died in the 1941 attack and they 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 U.S. veterans who survived the attack.

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

The leaders’ meeting 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.

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.

(Reporting by Jeff Mason in Pearl Harbor, Hawaii and Linda Sieg in Tokyo; additional reporting by Mohammad Zargham and Eric Beech in Washington; Editing by Alistair Bell and Lisa Shumaker)