(CNN) -- British Prime Minister Gordon Brown gave Northern Ireland's two leading political parties until Friday morning to reach an agreement that would save the province's self-rule, he announced Wednesday.
He was speaking after spending nearly two days locked in emergency talks with the pro-British Democratic Unionist Party, the pro-Irish Sinn Fein, and Irish Prime Minister Brian Cowen.
He called for the DUP and Sinn Fein to come back with proposals in 48 hours.
"If there is no agreement by Friday morning... we will publish our proposals," he warned, with Cowen standing at his side.
Brown and Cowen are trying to prevent the collapse of the current Northern Ireland Assembly, which would force new elections.
Because the power-sharing deal set up by the Good Friday agreement in 1998 is fragile, there are fears that new elections could imperil the peace process.
Brown skipped his weekly grilling by lawmakers in the House of Commons in order to stay for the meetings in Northern Ireland.
Months of disagreement between the DUP and Sinn Fein over the transfer of policing and justice reached a head last week, when talks between the parties broke down. The sides met again Monday to try to resolve the impasse, and Cowen flew to London to discuss the situation with Brown.
Brown flew to Belfast on Monday for an unscheduled day of talks with all sides -- talks which lasted nearly 48 hours, until Brown's announcement on Wednesday.
Sinn Fein has threatened to walk out of Northern Ireland's power-sharing government if no agreement is reached soon. That would force the Northern Ireland secretary to call new elections for the Assembly, Northern Ireland's legislature, and could further delay any agreement on Northern Ireland assuming policing and justice authority.
DUP leader Peter Robinson and a Sinn Fein spokesman said Tuesday that they were prepared to meet until they reached a deal.
The situation has drawn the attention of U.S. Secretary of State Hillary Clinton, who spoke to Brown on Tuesday and has expressed support for the peace process.