When Japanese prime minister Shinzo Abe decided to gamble on a snap election, it was less a declaration of self-confidence than a defensive move from a position of weakness. Called a year early ostensibly to deal with what Abe called a “national crisis” following a series of North Korean missile tests, the election came against a background of persistent questions on an influence-peddling scandal that sent the prime minister’s approval ratings into freefall over the summer. Knowing that Tokyo governor Yuriko Koike was preparing to run against him, he tried to wrong-foot her by going to the people early.

The manoeuvre paid off handsomely. During the campaign, the opposition Democratic Party collapsed, and Koike’s spin-off – the Party of Hope – never picked up momentum. In Sunday’s election, Abe’s Liberal Democratic Party (LDP) was returned with 310 seats out of 465 in the lower house of parliament – a result that gives the LDP-led coalition enough seats to reach the two-thirds mark it will need to push through Abe’s plan to revise Japan’s pacifist constitution. Assuming he stays in office until the Tokyo Olympics in 2020, Abe will become the longest-serving Japanese leader in the postwar era.

Japanese prime minister Shinzo Abe, leader of the Liberal Democratic Party (LDP), during a news conference after Japan’s election, in Tokyo on Sunday. Photograph: Isse Kato/Reuters

The North Korean threat is real and alarming. Japan must cleave tight to the US and hope for a steadier approach from President Trump

He faces daunting challenges, however. The North Korean threat is real and alarming. Japan has no leverage over Pyongyang and poor relations with the one country that does – China – so it must cleave tight to the US and hope for a steadier approach from US president Donald Trump, who visits Japan next month. Changing the constitution so as to spell out the military role of the country’s Self-Defence Forces, which would require a two-thirds vote of parliament and a national referendum, would shore up Abe’s legacy among conservatives and those who feel the postwar constitution, drawn up during the American-led occupation, was a national humiliation. But it would also risk exposing a deep split in a country where polls consistently show strong public support for the pacifist clause.

Full employment helped Abe secure re-election, but Japan’s economic problems run deep. His government’s stimulus policies – one of the key prongs of the famous Abenomics – have limited the impact of the country’s declining competitiveness, but the root problems – a huge debt burden of $10 trillion and a rapidly ageing population – remain to be addressed.

Abe himself, meanwhile, is less popular that the election result suggests. The LDP gained not only from the opposition’s implosion but from an electoral system that over-represents more conservative rural areas and privileges the incumbent by giving it better access to television and newspapers. Abe may look unassailable, but looming confrontations may well show him to be more vulnerable than he appears.