Leaders in Scotland and Wales complain of austerity, and the DUP’s rivals in Northern Ireland say deal threatens peace.

British Prime Minister Theresa May’s deal with Northern Ireland’s Democratic Unionist Party on Monday drew angry criticism from opponents.

May’s minority government agreed to a massive injection of funds into Northern Ireland in exchange for DUP support in parliament to endorse her legislative agenda after her Conservative Party’s dismal performance in the June 8 general election.

Leaders in Scotland and Wales said their countries get little while Northern Ireland will receive a bonanza, while the DUP’s rivals in Northern Ireland said the deal violates the Good Friday peace agreement and threatens the future of the power-sharing government there.

Ian Blackford, a Scottish National Party politician, said his party would do everything possible to make sure Scotland gets “its fair share” under a formula that prescribes how UK government funds are shared by England, Scotland, Wales and Northern Ireland.

READ MORE: How has the UK changed since the Brexit vote?

“After weeks of secret backroom negotiations, the Tories have now signed a grubby deal with the DUP,” Blackford said. “For years, the Tories have been cutting budgets and services, but suddenly they have found a magic money tree to help them stay in power.”

Welsh First Minister Carwyn Jones tweeted that the deal “flies in the face of the commitment to build a more united country”.

The package includes 1bn pounds ($1.27bn) of new funding and 500m pounds ($638m) of previously announced funds to help Northern Ireland to develop its infrastructure, health services and schools.

The DUP has 10 seats in parliament, enough to guarantee passage of the government’s Brexit-dominated agenda announced last week in the Queen’s Speech that marked the opening of a new parliament.

May downplayed policy differences between her party and the more socially conservative DUP, which opposes abortion and same-sex marriage, and said the two parties “share many values”.

“We also share the desire to ensure a strong government, able to put through its programme and provide for issues like the Brexit negotiations, but also national security issues,” May said.

Democratic Unionist Party leader Arlene Foster said the agreement would “address the unique circumstances” of Northern Ireland.

Al Jazeera’s Neave Barker, reporting from Westminster, said that the deal is “something of a triumph for the DUP’s largely working-class voter base – diluting the government’s current programme of austerity and spending cuts.”

Extra funding under austerity

The money for Northern Ireland raised questions at a time of severe budget shortages.

British politicians are seeking additional funding for the police and security services after recent attacks, as well as more and better public housing following a high-rise apartment block fire that killed at least 79 people.

Opposition Labour Party leader Jeremy Corbyn said the agreement suits May’s wish to stay in power but does little for the country.

WATCH: UK election – N Ireland waits to see how May deal helps DUP

“Where is the money for the Tory-DUP deal coming from?” the Labour leader asked. “And, will all parts of the UK receive the much-needed additional funding that Northern Ireland will get as part of the deal?”

As part of the arrangement, funds will be earmarked to address a major traffic bottleneck involving three busy roads, as well as improving high-speed internet services in Northern Ireland.

It also provides 200m pounds ($255m) over two years to better Northern Ireland’s health service, 100m pounds ($127m) for immediate health needs and education. There will be 100m pounds over five years for poverty programs and 50m ($64m) for mental health programmes.

‘Threatening’ the peace process

Northern Ireland’s other political parties, principally Sinn Fein, have objected to a Conservative alliance with the DUP. They say it jeopardises the government’s pledge to be a neutral arbiter as part of the Good Friday agreement, which in 1998 brought peace to Northern Ireland after decades of sectarian strife.

Sinn Fein president Gerry Adams said the deal means a continuation of Conservative Party policies.

“The price of today’s DUP-Tory deal is DUP support for continued Tory austerity and cuts to public services,” Adams said.

“It provides a blank cheque for a Tory Brexit which threatens the Good Friday Agreement.”

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

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

“Many Republicans believe the Conservative-DUP partnership threatens to upset the pollitical balance. They’ve called the deal a betrayal, destined to end in tears,” said Al Jazeera’s Neave Barker.

“But for Theresa May it’s the start of a necessary and potentially challenging partnership.”