An American president in Hiroshima. A Japanese prime minister at Pearl Harbour. One long-time taboo has already fallen this year, and the other soon will.

On December 27, Prime Minister Shinzo Abe will visit the Hawaiian US naval base attacked by Japan in 1941. He will be joined by President Barack Obama, who seven months earlier travelled to Hiroshima to pay tribute to the 140,000 people killed there by a US atomic bomb in 1945. The two attacks bookend World War II in the Pacific.

The importance of the visits may be mostly symbolic for two countries that, in a remarkable transformation, have grown into close allies in the decades since they faced off in brutal conflict. At the same time, it's significant that it took more than 70 years for US-Japanese relations to get to this point. The two gestures of reconciliation are in some ways an attempt to sweep out the final ghosts of the war.

“Despite the amicable relationship that the two countries have enjoyed since the end of the Pacific War, deep-rooted negative sentiment has remained in both countries,” said Narushige Michishita, a security expert at the National Graduate Institute for Policy Studies in Tokyo. “The Obama-Abe joint visit to Pearl Harbour will change this.”

Several factors have helped both Obama and Abe step in hallowed places their predecessors did not:

For young Americans, Pearl Harbour is an event in history textbooks, but Japan is more likely to conjure up images of manga and sushi. Japanese students learn about the atomic bombings of Hiroshima and Nagasaki, but the message is not to hate America but to prevent such a tragedy from happening again.

“The amount of time passed is an important factor,” said Tsuneo Watanabe, a senior research fellow at the Sasakawa Peace Foundation in Tokyo.

“As survivors become fewer, the event becomes part historical memory,” said Tosh Minohara, a US-Japan expert at Kobe University in Japan.

To the mix, he added the concern in the US and Japan about China's emergence as a military power in the Pacific.

“I think the appearance of a new potential adversary also made this possible,” he said. “The UD will have to depend on Japan more and more.”

Obama, a liberal Democrat, and Abe, a relatively staunch conservative, seem unlikely partners for this dance.

On a 2014 visit to Japan, Obama was described by the Japanese media as “businesslike,” in contrast to Abe, who was said to be looking to develop a personal bond with the American leader.

Their interests dovetailed over Hiroshima. For Obama, a world without nuclear weapons is a stated if unachieved goal, and Hiroshima was a powerful place to deliver that message one more time in the last year of his presidency.

Abe could bask in the limelight as the Japanese leader who brought an American president to Hiroshima, a visit long hoped for by survivors of the atomic bomb and widely welcomed by the public.

At the time, Abe said he had no “specific plan” to visit Pearl Harbour, sidestepping suggestions that reciprocity was called for.

However, in announcing his visit to Pearl Harbour on Monday, he revealed that he has been thinking about the importance of a visit and reconciliation for more than a year, and that he and Obama finalised it when they met at a G20 meeting in Peru last month.

World War Two Photo Essay: The Final Weeks Show all 20 1 /20 World War Two Photo Essay: The Final Weeks World War Two Photo Essay: The Final Weeks World War Two Photo Essay: The Final Weeks April 28th 1945: Benito Mussolini and his mistress Clara Petacci are executed as they attempt to flee the country. Their beaten bodies are hung by their heels in Milan. World War Two Photo Essay: The Final Weeks April 30th 1945: Adolf Hitler and his wife Eva Braun commit suicide. World War Two Photo Essay: The Final Weeks April 30th 1945: Karl Dönitz succeeds as President while Joseph Goebbels succeeds as Chancellor. World War Two Photo Essay: The Final Weeks May 1st 1945: Joseph Goebbels and his wife commit suicide after killing their six children. Karl Dönitz appoints Count Lutz Graf Schwerin von Krosigk as Chancellor. World War Two Photo Essay: The Final Weeks May 2nd 1945: The Soviet Union announces the fall of Berlin. Meanwhile, the concentration camps Lübeck and Neuengamme are liberated by the British Army. World War Two Photo Essay: The Final Weeks May 7th 1945: General Alfred Jodl signs unconditional surrender terms at Reims in France, ending Germany's participation in the war. World War Two Photo Essay: The Final Weeks May 8th 1945: V-E Day commemorates the end of World War II in Europe, with the final surrender being to the Soviets in Berlin. World War Two Photo Essay: The Final Weeks May 9th 1945: Hermann Göring is captured. World War Two Photo Essay: The Final Weeks May 23rd 1945: Karl Dönitz and Count Lutz Graf Schwerin von Krosigk are arrested. World War Two Photo Essay: The Final Weeks Heinrich Himmler, former head of the Nazi SS, commits suicide in British custody. World War Two Photo Essay: The Final Weeks June 5th 1945: The Allied Control Council formally takes control of Germany. World War Two Photo Essay: The Final Weeks July 1st 1945: Germany is divided between Allied occupation forces. World War Two Photo Essay: The Final Weeks July 16th 1945: The first of an atomic bomb - the Trinity Test - takes place. World War Two Photo Essay: The Final Weeks July 26th 1945: Winston Churchill loses the 1945 general election. Clement Attlee becomes Prime Minister. World War Two Photo Essay: The Final Weeks July 30th 1945: The USS Indianapolis is sunk by torpedoes from a Japanese submarine in the Philippine Sea. World War Two Photo Essay: The Final Weeks August 9th 1945: A US B-29 Bomber named the Bockscar drops an atomic bomb - codenamed Fat Man - on Nagasaki. World War Two Photo Essay: The Final Weeks August 9th 1945: A US B-29 Bomber named the Bockscar drops an atomic bomb - codenamed Fat Man - on Nagasaki. World War Two Photo Essay: The Final Weeks August 15th 1945: Emperor Hirohito announces Japan's surrender on the radio. World War Two Photo Essay: The Final Weeks September 2nd 1945: World War II ends with the final official surrender of Japan being accepted.

Some American conservatives and military veterans opposed Obama's visit to Hiroshima, but he rode out the storm.

In contrast, Japanese conservatives have been relatively quiet about Abe's planned visit to Pearl Harbour, and even supportive. The right-leaning Sankei newspaper called it “an attempt to end the postwar era” and move beyond “a framework of winners versus losers.”

It helps that Abe is a conservative himself. He also faces few political challengers after holding onto office for coming on four years, making him the fourth-longest-serving prime minister since World War II.

“He gets understanding from his conservative supporters, who give him credit for his policies,” Watanabe said. “A visit to Pearl Harbour by a liberal leader would have been more difficult.”

Obama's visit to Hiroshima also helped in a society in which gift-giving and favors should be reciprocal.

“In a way, it was only appropriate,” Minohara said.