Shinzo Abe resigned Wednesday as Japan's longest-serving prime minister, ending a tenure studded with headline-grabbing moments, from a turn as Super Mario to a controversial shrine visit that sparked regional anger.

Here are some of the most memorable moments of Abe's record-breaking time in office.

- The Bromance -

Abe made building a close personal relationship with US President Donald Trump a cornerstone of protecting the key alliance.

Abe cultivated a close personal relationship with Trump, including bonding over rounds of golf / © The Prime Minister's Office of Japan/AFP/File

In 2016, he flew to New York to chat with the then president-elect, becoming the first foreign leader to meet Trump at his Manhattan skyscraper.

The pair regularly golfed together, and Trump was the first head of state to meet Japan's new emperor.

But there were plenty of awkward moments.

In 2017, a video went viral of Trump almost wrestling with Abe in a handshake that lasted 19 seconds and ended with the Japanese leader visibly grimacing and appearing relieved the encounter was over.

And then there was their 2018 golf game, when Abe tumbled backwards into a bunker and Trump marched down the fairway seemingly oblivious.

- Super Mario -

In 2016, Abe appeared dressed as Super Mario for the handover ceremony at the close of the Rio Olympics / © AFP/File

It was about the last thing anyone expected from Japan's straight-laced prime minister, but in 2016, Abe decided to show his commitment to the Tokyo Olympics in rather unusual fashion -- by appearing as video game icon Super Mario.

He donned the disguise for the official handover ceremony after the Rio Games, appearing thanks to some digital trickery to tunnel through the earth from Japan to Brazil where he popped up in full costume.

"I wanted to show Japan's soft power to the world with the help of Japanese characters," he told reporters.

It was a far cry from the seriousness with which he controversially declared the stricken Fukushima power plant "under control" in 2013, two years after a nuclear meltdown, as he pitched for the Games.

And with coronavirus forcing a historic year-long delay to the 2020 Games, Abe will now miss out on appearing at the Tokyo opening ceremony.

- Banzai! -

Few political leaders can say their tenure literally involved the end of an era, but in Japan, the abdication of former Emperor Akihito meant the Heisei imperial era came to an end in 2019.

Japan's Abe assisted in the tradition-bound official ascension to the throne of the new emperor, leading a cheer of Banzai! / © POOL/AFP/File

The new Reiwa era began in May 2019 and Emperor Naruhito formally ascended the Chrysanthemum throne in October, in a ceremony steeped in tradition and grandeur.

As prime minister, Abe had a once-in-a-generation role at centre stage, and addressed the new monarch, pledging the people of Japan would "respect your highness the emperor as the symbol of the state and of the unity of the Japanese people."

He then raised his hands three times, shouting the phrase: "Banzai!" or "Long live the emperor!"

- Controversial shrine trip -

Abe inflamed tensions in the region in 2013 when he visited the controversial Yasukuni shrine honouring war dead including convicted war criminals / © AFP/File

There were plenty of less light-hearted moments in Abe's tenure, including his 2013 visit to Yasukuni, a shrine that venerates the souls of Japan's war dead, including some convicted by a US tribunal of war crimes.

The shrine is seen by some in the region as a symbol of Tokyo's past militarism and Abe's visit prompted outrage from China and South Korea and even a US rebuke.

Abe said the trip was not intended to inflame tensions, but he stayed away afterwards, sending only ritual offerings in following years.

- Hiroshima & Pearl Harbor -

Abe has said little about what he thinks his legacy will be, but he has cited one particular point of pride: bringing then-US president Barack Obama to Hiroshima in 2016.

Abe said bringing then-US president Barack Obama to Hiroshima, making him the first sitting US leader to visit, was among his proudest moments / © AFP/File

Obama became the first sitting US president to visit the site, where he paid tribute to victims of the world's first atomic attack, though stopping short of offering an apology for the bombing.

Later that year, the two leaders made a poignant joint pilgrimage to Pearl Harbor, the first visit by a sitting Japanese leader to the memorial there, issuing symbolic declarations about the power of reconciliation and warning against the drumbeat of conflict.