Australian prime minister Scott Morrison looked set to form a majority government as vote counting from the weekend election allayed any fears that his conservative coalition may have to rule in the minority.

The coalition was returned to power in a stunning result on Saturday night, after opinion polls and odds-makers had tipped the opposition Labor Party to win.

The outcome ranks as Australia’s biggest election upset since 1993, when Labor prime minister Paul Keating was returned to power.

With 76 seats in the House of Representatives needed for majority rule, figures from the Australian Electoral Commission on Monday showed 84% of the votes had been counted, with the coalition on target to win 77 seats — an increase of four after going into the election as a minority government.

The Labor Party was set to claim 68 seats, with independents and minor parties taking six.

Winning at least 77 seats would also allow Mr Morrison’s coalition to appoint the house speaker from its own ranks, rather from among independent or minor party lawmakers.

As Mr Morrison began finalising his new Cabinet on Monday, the stock market welcomed the election result.

Australia’s benchmark ASX 200 index was up 1.7% in late-afternoon trading — reaching its highest level since 2007, just before the global financial crisis.

After being elected in 2016 with 76 seats, the power base of Mr Morrison’s coalition was diminished through a series of by-elections late in its three-year term.

One such defeat was triggered by the ousting in an internal party vote of former prime minister Malcolm Turnbull.

That move, which ended in Mr Morrison becoming prime minister last August, caused widespread disgust among an Australian electorate sorely disillusioned by seeing another one of its leaders replaced without them having a say.

Mr Morrison had become Australia’s sixth prime minister in only eight years.

Four such changes had been brought about by MPs voting to dump their party’s leader, two each from the coalition and the centre-left Labor Party.

Mr Morrison’s predecessor, Mr Turnbull, had himself become prime minister in 2015 through an internal party coup that dumped Tony Abbott as leader of the Liberal Party.

Analysts has predicted that the coalition would pay dearly for this latest leadership switch, with Mr Morrison expected to exit after one of the shortest terms as prime minister in Australian history.

Most late surveys showed Labor leader Bill Shorten as having a small but clear lead over Mr Morrison as preferred prime minister, at 51% to 49%.

With Mr Shorten announcing his resignation as Labor leader on Saturday night, the party began the task of finding a new leader on Monday.