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 more than two weeks of talks amid political turmoil sparked by May’s failure to win a majority in a June 8 snap election, May can now be sure her government can pass a budget and Brexit legislation.

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

The deal 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 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 laced 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, upping pressure on the DUP to make an agreement with their Catholic nationalist rivals.

“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.”

The deal with the DUP, which won 292,316 votes in the 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.

Even with the DUP’s lawmakers onside, May’s effective majority is slim and her position remains insecure though she has promised to get her Conservative Party out of what she termed the mess of the election.

May’s Brexit strategy 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.

NORTHERN IRELAND

While May negotiated the DUP deal, senior Conservatives such as former Prime Minister John Major raised concerns an agreement risks thrusting the province back into turmoil by convincing ‘hard men’ on both sides of the 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 1998 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 government in January, prompting an election in March and a series of missed deadlines to restore the compulsory coalition between Irish 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 the British government for the parties in Northern Ireland to reach an agreement is Thursday. Sinn Fein said last week that “time was running out” given the lack of knowledge about the impact of any Conservative/DUP deal.

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