Leo Varadkar has resigned. (Donall Farmer/Getty)

Leo Varadkar formally resigned as taoiseach two weeks after Fine Gael lost Ireland’s general election.

Varadkar said he would continued on as caretaker leader until a new taoiseach was elected and urged MPs to come together to form a new coalition government.

“The responsibility is on all of us to ensure we provide good government, and indeed good opposition,” he told the Dáil Éireann on Thursday, February 20.

“I think the onus is on those who have made enormous promises of change to the people during this election who are entrusted with that mandate to bring a programme of government for approval.

“If they cannot, they should say so and be upfront and honest about their failures and the empty promises they made.”

He spoke after the Irish parliament tried and failed to nominate a new taoiseach, with all candidates falling far short of the required 80 seats as expected.

Sinn Fein leader Mary Lou McDonald led the vote with 45, ahead of Fianna Fáil leader, Micheál Martin (41), Varadkar (36) and Green Party leader Eamon Ryan (12).

The vote was largely a formality, with coalition talks at early stages. After parliament was adjourned party leaders now have until March 5 to try to make sense of the political arithmetic.

Sinn Féin victory came as shock to Ireland.

The Sinn Féin won a surprise victory in the popular vote in the February 8 election, but fell short of a majority with 37 seats once second preferences were taken into account.

Both of the major centre-right parties, Fianna Fáil (which won 38 seats) and Fine Gael (which won 35) have ruled out going into coalition with their left-wing rival.

Martin has said that his party will try to rule without Sinn Féin, saying that a coalition with them “would not be the right thing to do”.

He instead will try to engage his party’s historic rival, Fine Gael, in talks aimed at producing an unprecedented coalition.

Varadkar however has said he is prepared to go into opposition, having also ruled out working with Sinn Féin.

Speaking in parliament on Thursday, Martin reiterated his opposition to the party on account of its links to the IRA during and after the Troubles.

“When I raised the issue of the systematic cover-up of child abuse by the Provisional IRA, I was called a lowlife by deputies present here today,” he said.

McDonald accused Martin of having a “narrow and bitter mind”, adding: “Fine Gael and Fianna Fáil have had the run of this place for a century, and by Christ, they’re not prepared to let go.”