The two coalition partners, the Progressive Party and the Independence Party, agreed after talks late Wednesday to hand the prime ministerial post to the agriculture minister Sigurdur Ingi Johannsson, 53, of the Progressives.

"We expect to have elections this autumn," Mr Johannsson told reporters, insisting that the coalition, in power since 2013, would continue to run the country's affairs despite thousands of protesters calling for the whole government's resignation.

"We will continue our work together. We are of course hoping this will help bring stability in the political system," he said.

Sigmundur David Gunnlaugsson, 41, stepped down on Tuesday amid massive public protests over a hidden offshore account.Credit:
EPA

President Olafur Ragnar Grimsson, who at 72 is due to retire in June after five terms and 20 years in office, is expected to approve Mr Johannsson's appointment.

Iceland's next legislative elections were originally scheduled for April 2017.

Mr Gunnlaugsson, who remains the head of the Progressive Party for the time being, was the first major political casualty to emerge from the leak of millions of documents detailing offshore accounts held by world leaders and celebrities.

Watch | Iceland's PM walks out of interview over tax haven question

00:37

Two other Iceland cabinet ministers have been singled out in the leak - Finance Minister Bjarni Benediktsson and Interior Minister Olof Nordal - and the coalition is keen to stall for time to avoid what would surely be a resounding protest vote if a snap election were held soon.

The coalition parties "have lost all their legitimacy, but I am sceptical they will leave of their own initiative. Time is on their side and it's crucial for them to stay in power," lamented Gyda Margret Petursdottir, a 42-year-old teacher who was one of hundreds who protested against the government outside parliament on Wednesday.

Thousands of protesters have been calling for the Iceland government's resignation over the Panama Papers scandal.Credit:
Getty

The Panama Papers, revealed by the International Consortium of Investigative Journalists (ICIJ), showed that Mr Gunnlaugsson and his wife owned an offshore company in the British Virgin Islands and had placed millions of dollars of her inheritance there.

The prime minister sold his 50-percent share of the company to his wife for a symbolic sum of $1 at the end of 2009, but he had neglected to declare the stake as required when he was elected to parliament six months earlier.

Mr Gunnlaugsson has said he regretted not having done so, but insisted he and his wife had followed Icelandic law and paid all their taxes in Iceland.

It has not been proven the couple stood to gain financially from the offshore holding, and the ICIJ noted only that Mr Gunnlaugsson had "violated Iceland's ethics rules".

"There is a consensus between the opposition parties that we will push the vote of no-confidence"

Birgitta Jonsdottir

But the issue is particularly sensitive in Iceland, a country marked by the excesses of the 2000s when senior bankers used shell companies in tax havens to conceal their dealings in risky financial products which ultimately led to the 2008 collapse of the nation's three main banks.

The left-wing opposition presented a motion of no-confidence to parliament on Monday, and said late Wednesday it intended to push ahead with it despite the government's plans for an early election.

"There is a consensus between the opposition parties that we will push the vote of no-confidence," said Birgitta Jonsdottir, the founder of the libertarian Pirate Party which campaigns for more transparency in politics.

"We don't see the point in continuing with a government that has 26 percent trust," she said, acknowledging however that the motion had little chance of passing in parliament because of the government's majority.

A Gallup poll conducted Monday and Tuesday credited the Pirate Party with a whopping 43 percent of voter support, far ahead of the Independence Party at 21.6 percent, the opposition Left Green Movement at 11.2 percent, and the Progressives at 7.9 percent.