The president and prime minister made their remarks at the end of a long pier that overlooks Pearl Harbor and the memorial to the attack — a small building on top of the carcass of the battleship Arizona in Pearl Harbor, where 2,400 American sailors, Marines and others were killed in the surprise military strike on Dec. 7, 1941.
Mr. Abe and Mr. Obama laid wreaths made of white peace lilies at the memorial, and then dropped purple Hawaiian orchids into the water.
The war that began here ended with the United States dropping atomic bombs on Hiroshima and Nagasaki in August 1945. But out of the ashes of war, the two countries forged one of the most enduring partnerships of the past century, demonstrating that bitter enemies can make peace and become allies.
Mr. Abe thanked the United States for helping to rebuild Japan after the attacks.
“Under the leadership of the United States, Japan, as a member of the free world, was able to enjoy peace and prosperity,” Mr. Abe said. “The good will and assistance you extended to us Japanese, the enemy you had fought so fiercely, together with the tremendous spirit of tolerance, were etched deeply into the hearts and minds of our grandfathers and mothers.”
The ceremony was another chapter in the reconciliation between the countries and mirrored a similar event in May, when Mr. Obama visited the peace memorial in Hiroshima. In a speech there, Mr. Obama did not apologize for the dropping of the bombs but vowed to continue to work toward ridding the world of nuclear weapons — a message greeted warmly in Japan, the only country to suffer such an attack.
“Seventy-one years ago, on a bright cloudless morning, death fell from the sky and the world was changed,” Mr. Obama said at the time.
“Technological progress without an equivalent progress in human institutions can doom us,” Mr. Obama said, adding that such technology “requires a moral revolution as well.”
The Japanese have long had difficulty making sense of their country’s decisions during World War II. Some have rationalized the attack on Pearl Harbor as a necessary response to an American-led embargo that was destroying Japan’s economy. In the 1950s, three Japanese prime ministers— including Mr. Abe’s grandfather Nobusuke Kishi — visited Honolulu, although there is no record that they participated in a memorial ceremony at Pearl Harbor. In the decades that followed, senior Japanese leaders largely avoided the site.
When Emperor Akihito planned to visit the memorial in 1994, nationalist protests in Japan led to his canceling the visit.
But six months after Mr. Obama visited Hiroshima, Mr. Abe told the president in a meeting at an economic forum in Peru that he wanted to visit Pearl Harbor. In a statement earlier this month, the White House said that “the meeting will be an opportunity for the two leaders to review our joint efforts over the past four years to strengthen the U.S.-Japan alliance, including our close cooperation on a number of security, economic, and global challenges.”
The Japanese, who are increasingly alarmed about the rise of China, have largely embraced the visit, as many see it as a way to strengthen ties with the United States. There have even been suggestions in the Japanese news media that Mr. Abe’s approval ratings will rise in the days after the ceremony, strengthening his hand as he decides whether to call an election in January.
Mr. Abe has made closer ties with the United States a central part of his foreign policy, at least under Mr. Obama. President-elect Donald J. Trump has struck a far more hawkish tone toward Japan. During Mr. Obama’s visit to Hiroshima, Mr. Trump, at that time the presumptive Republican nominee, said on Twitter: “Does President Obama ever discuss the sneak attack on Pearl Harbor while he’s in Japan? Thousands of American lives lost.”
Mr. Trump has also criticized the Japanese for being too reliant on the United States for their country’s defense and for not paying enough for that protection. And Mr. Trump suggested that Japan would be better off if it had nuclear weapons.
Mr. Abe met with Mr. Trump in November at Trump Tower, in a meeting that Mr. Abe’s aides said left him feeling optimistic about the prospects of Japan’s relationship with the United States. But the Japanese remain deeply unnerved about Mr. Trump as they view his statements and the suggestion that Japan should acquire its own nuclear arsenal as undermining its strategic alliance with the United States and antithetical to the country’s pacifist Constitution.
Before Mr. Obama and Mr. Abe visited Pearl Harbor, they had a formal meeting at Marines Corps Camp H. M. Smith, where they discussed a wide range of issues, including trade.
The day’s events interrupted Mr. Obama’s vacation. Since becoming president, he has spent every Christmas in his native Hawaii. He arrived here 10 days ago and has spent his time golfing and seeing friends. On Christmas Day, he and his wife, Michelle Obama, visited troops stationed here. He is expected to be in Hawaii through the New Year.
The day marked what is likely Mr. Obama’s last meeting with a foreign leader as president, as there are just 24 days left before Mr. Trump is to be sworn in.