LONDON (Reuters) - Prime Minister Theresa May struck a deal on Monday to prop up her minority government by agreeing to at least 1 billion pounds ($1.3 billion) in extra funding for Northern Ireland in return for the support of the province’s biggest Protestant party.

After over two weeks of talks and turmoil sparked by May’s failure to win a majority in a June 8 snap election, she now has the parliamentary numbers to pass a budget and a better chance of passing laws to take Britain out of the European Union.

May and Democratic Unionist Party (DUP) leader Arlene Foster presided at the signing of a three-page so-called “confidence and supply” deal that is some way short of a more formal coalition agreement.

It means the DUP’s 10 lawmakers will now vote in support of May’s 318 Conservatives in the 650-seat parliament on the budget, legislative agenda, motions of confidence and Brexit.

In return, May agreed to at least 1 billion pounds ($1.3 billion) in extra funding over two years for Northern Ireland, agreeing to raise pensions annually by at least 2.5 percent and to keep universal winter fuel payments for the elderly.

“I welcome this agreement, which will enable us to work together in the interest of the whole United Kingdom, give us the certainty we require as we embark on our departure from the European Union, and help us build a stronger and fairer society at home,” May said in a statement.

May linked her deal with an attempt to end Northern Ireland’s political crisis by stipulating the money would only be released to a power-sharing executive in Belfast, raising pressure on the DUP to come to an agreement with their Catholic nationalist rivals.

However a Conservative party spokesman said that there would be a mechanism for the money to be released via a consultative committee even without a deal to restore power-sharing.

“The Conservative Party has recognized the case for higher funding in Northern Ireland given our unique history and circumstances over recent decades,” DUP leader Foster told reporters in Downing Street. “We welcome this new financial support of 1 billion pounds.”

Leaders of Scotland and Wales voiced anger at the deal, saying it would weaken, not strengthen, the ties that bind the United Kingdom by “throwing money” at one of its devolved regions at the expense of others.

“Today’s deal represents a straight bung to keep a weak prime minister and a faltering government in office,” said Welsh First Minister Carwyn Jones of the Labour party.

Scotland First Minister Nicola Sturgeon said: “In concluding this grubby, shameless deal, the Tories (Conservatives) have shown that they will stop at nothing to hold on to power – even sacrificing the very basic principles of devolution.”

Gerry Adams, president of the Irish Catholic nationalist Sinn Fein party, said the deal provides a “blank cheque” for a Brexit that threatens peace in Northern Ireland.

Slideshow ( 15 images )

The deal with the DUP, which won 292,316 votes in the June 8 election, will run for the life of the current parliament due to end in 2022 but will be reviewed after each parliamentary session and most of the funding is due in the first two years.

Opposition Labour leader Jeremy Corbyn questioned how the government had found a billion pounds given planned spending cuts, which he said should now be canceled for all the United Kingdom, not just the province of Northern Ireland.

Even with DUP lawmakers onside, May’s effective majority is slim and her position remains insecure though she has promised to extricate the Conservatives from what she termed the “mess” of the election.

Slideshow ( 15 images )

Her strategy for a complete break of Britain from the EU is under scrutiny and her future as prime minister is the subject of public debate with speculation that she could be challenged from within her own party within months.

FRAGILE PEACE IN NORTHERN IRELAND

While May negotiated the DUP deal, senior Conservatives such as ex-Prime Minister John Major raised concerns the deal risks pitching the province back into turmoil by convincing “hard men” on both sides of the sectarian divide to return to violence.

The fear was that increasing the influence of pro-British unionists over the British government could create the perception that London was no longer an honest broker of the peace settlement reached in 1998.

The U.S.-brokered Good Friday agreement brought an end to three decades of violence in Northern Ireland that killed 3,600 people.

Northern Ireland has been in crisis since Sinn Fein pulled out of its government in January, prompting an election in March and a series of missed deadlines to restore the compulsory coalition between Catholic nationalists and pro-British Protestant unionists.

“I will be returning to Northern Ireland to continue our discussions as we attempt to re-establish the Northern Ireland Executive,” Foster said. “Now more than ever, political leaders, both locally and nationally, need to work together to find solutions for all the people we serve.”

The latest deadline set by May’s government for the parties in Northern Ireland to reach a deal is Thursday. Sinn Fein said the extra money for Northern Ireland would not in itself guarantee that power-sharing in the province would be restored by the new deadline.

“Time is running short for the parties to come together and reach agreement to re-establish power-sharing,” May said. “Northern Ireland needs a functioning devolved government at this important time.”