Japanese Prime Minister Shinzo Abe’s rare visit with President Barack Obama came together at Pearl Harbor on Tuesday and spoke of how former enemies can mend bonds and form powerful alliances that outlive the devastating effects of war.

"As the prime minister of Japan, 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," Japanese Prime Minister Shinzo Abe said Tuesday during joint remarks with Obama at Joint Base Pearl Harbor-Hickam.

President Obama said Tuesday that the meeting reminder that "even the deepest wounds of war can give way to friendship and lasting peace."

The president said "the fruits of peace always outweigh the plunders of war. This is the enduring truth of this hallowed harbor."

"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, we must resist the urge to demonize those who are different," he added.

Japanese Prime Minister Shinzo Abe and President Barack Obama participate in a wreath-laying ceremony aboard the USS Arizona Memorial at Pearl Harbor, Hawaii on Dec. 27, 2016. Kevin Lamarque / Reuters

Abe's visit comes 75 years after the attack on Pearl Harbor and his attendance at the USS Arizona Memorial marks the first such visit in decades by a Japanese prime minster. During the Japanese attack on Pearl Harbor, 2,403 Americans were killed on Dec. 7, 1941.

It also comes seven months after Obama became the first sitting American president to visit the Japanese memorial dedicated to the more than 200,000 people killed when American forces dropped two atomic bombs on Hiroshima and Nagasaki in August 1945.

Other Japanese primer ministers have made the trek before in the years just after the war.

Former leader Shigeru Yoshida went there just six years after the country's World War II surrender.

Related: Thousands Pay Tribute at Pearl Harbor, 75 Years After Attack

Yoshida signed the San Francisco peace treaty with the U.S. and others in 1951, allowing Japan back into international society after its war defeat. His Pearl Harbor visit, which he made on his way home from San Francisco, was largely eclipsed by the historic treaty.

Japanese Prime Minister Shinzo Abe presents a wreath at the National Memorial Cemetery of the Pacific at Punchbowl in Honolulu, Hawaii on Dec. 26, 2016. Hugh Gentry / Reuters

Former PM Nobusuke Kishi, Abe’s grandfather, also made the trip in 1957. And Ichiro Hatoyama visited the year before.

"While not the first Japanese Prime Minister to visit the site of the infamous attack, Shinzo Abe’s trip to Pearl Harbor ... is a meaningful measure in a much larger effort to enhance the U.S.-Japan alliance," Harry Kazianis, a director of defense studies at the Center for the National Interest, a Washington D.C. foreign policy think tank, said in a statement.

There is also another important and more pragmatic reason for Japan and U.S. cooperation, Kazianis said, "an increasingly aggressive China."