DUBLIN — Northern Ireland leaders reached agreement to sustain their troubled Catholic-Protestant government on Tuesday following all-night Belfast talks that reduced some to bleary-eyed exhaustion.

British Prime Minister David Cameron in London heralded a deal that became possible when his government offered an extra 2 billion pounds ($3.2 billion) over the coming decade to Northern Ireland.

Cameron said the financial boost, largely loans from the British Treasury, “opens the way for more prosperity, stability and economic security for Northern Ireland.”

It will allow Northern Ireland to avoid cutting welfare payments as sharply as in the rest of the United Kingdom. Sinn Fein, the major Irish nationalist party representing the Catholic minority, had thrown power-sharing into turmoil over the past year by refusing to enact London-ordered cuts – and said Cameron’s offer had vindicated its stubborn stand.

“Sinn Fein as a party has a duty and responsibility to stand up for the most disadvantaged and disabled people in our society,” said Deputy First Minister Martin McGuinness, the former Irish Republican Army commander.