The Westminster government is prepared to legislate on welfare reform in Northern Ireland if Stormont's parties cannot agree their own package of changes, Theresa Villiers has said.

The Northern Ireland secretary said such a move would be the "last resort".

The NI parties had agreed on a welfare reform deal in December but Sinn Féin withdrew its support in March.

Sinn Féin's Martin McGuinness said it would be a "huge mistake" for Westminster to try to impose cuts.

Speaking at the British Irish conference in Cambridge, Ms Villiers said: "We have come to the conclusion that if the executive cannot reach agreement on implementing the budget and welfare aspects of the Stormont House Agreement, as a last resort the government will have to step in and legislate at Westminster for welfare reform in Northern Ireland.

Ms Villiers said such action by the government would be taken "reluctantly" and only if all other "realistic alternatives" had been exhausted.

She urged the executive to take action to repair its public finances.

"That means dealing with the in-year pressures in their budget in the next in-year monitoring round and it means implementing the welfare reform package agreed by the five parties during their Stormont Castle negotiations," she said.

"Without these two crucial steps, the budget agreed by the executive in June just does not add up and we face the alarming prospect of the executive breaching its control totals and starting to run out of money."

Ms Villiers said those who continued to block welfare reform had a "choice".

"They can do what virtually every responsible government across the world has had to do in recent years, including in the UK and Ireland, and that is to make difficult choices to live within their means," she said.

Quote

"Or they can continue down a path of reckless irresponsibility with the damaging consequences that will have for frontline public services and the people who depend on them.

"The government is firmly committed to the full implementation of the Stormont House Agreement and the financial package that underpins it."

Mr McGuinness, the deputy first minister, said: "Any move by the British government to impose its welfare cuts agenda over the heads of the assembly and executive will seriously undermine devolution and the political institutions. It would be a huge mistake.

"This Tory government appears to be willing to jeopardise years of political progress for its own narrow right wing agenda."

But DUP leader Peter Robinson, the first minister, welcomed Ms Villier's speech as a "potential game changer", adding: "There is no doubt that this statement will introduce a dose of reality to these negotiations and make a resolution more likely."

Ms Villiers also told the audience on Saturday that she would release funding to allow the civil service voluntary exit scheme to go ahead.

Quote

The £700m scheme, which was agreed as part of the Stormont House Agreement, has faced uncertainty because of the continuing impasse over welfare reform.

The aim of the civil service exit scheme is to help Stormont balance its budget by shedding the equivalent of 2,400 full-time civil service posts.

It is believed the scheme could save about £90m from the civil service's annual pay bill.

The first 864 civil servants are due to leave on 30 September.

On Thursday, Downing Street confirmed that "urgent, intensive and focused cross-party talks" would begin next week in Belfast in an attempt to resolve the crisis at the assembly.

It was sparked by the recent murder of Kevin McGuigan Sr.

The 53-year-old ex-IRA man, was killed in what police believe was part of a "fall-out" in republican circles after the murder of former IRA commander Gerard 'Jock' Davison in May.

The Ulster Unionists withdrew from the executive after police said Provisional IRA members had a role in Mr McGuigan's killing.

Police said an infrastructure exists at a senior level of the Provisional IRA, but that there was no evidence that Mr McGuigan's murder was sanctioned by that hierarchy.

The talks, which will be held at Stormont House, will be led by Ms Villiers.

The talks will cover two issues - securing the full implementation of the Stormont House Agreement and paramilitary activity.

The five biggest parties have been asked to take part in the discussions.

The Northern Ireland Executive is a power-sharing government drawing ministers from the five biggest parties.