Updated: June 10, 12:34 p.m. EDT

At the end of an election campaign that was nasty, brutish and short, British voters punished Prime Minister Theresa May at the polls on Thursday, depriving her Conservative Party of its governing majority in Parliament, and forcing her to rely on the support of a small party of extremists from Northern Ireland to stay in office.

Despite a late surge in support for the opposition Labour Party, whose leader Jeremy Corbyn offered a more uplifting vision of the future, the Conservatives managed to hold on to most of their seats, but are now the largest party in what’s known as a hung Parliament, where no single party can rule without some form of support from at least one other.

May said on Friday that she would govern with the backing of the Democratic Unionist Party, or D.U.P., extreme social conservatives from the Ulster Protestant community whose main aim is keeping the United Kingdom of Great Britain and Northern Ireland intact, by rejecting demands for a united Ireland.

As several commentators observed on Friday, the British public generally pays no attention to politics in Northern Ireland, and so might be in for a shock to discover just how extreme members of the D.U.P. are.

The party, founded by the virulently anti-Catholic, evangelical preacher Ian Paisley — who once denounced Pope John Paul II to his face as “the Antichrist” — still includes fundamentalist Christians who believe in creationism but not climate science, and have fought to keep U.K. laws permitting both abortion and same-sex marriage from being implemented in Northern Ireland.

According to research by Jon Tonge, a British and Irish politics professor at the University of Liverpool, 63 percent of D.U.P. members are against the legalization of abortion, 66 percent say that homosexuality is wrong, and 75 percent would mind if a relative married someone of a different religion.

Sixty-eight percent of the party’s members voted against the Good Friday Agreement that ended three decades of sectarian, armed conflict in 1998 and established a local government in which power is shared by the region’s mainly Protestant unionists, who see themselves as British, with its mainly Catholic nationalists, who consider themselves Irish. Seventy-three percent of the party’s members say they would vote against the agreement now. That might help to explain why the D.U.P. leader, Arlene Forster, has refused a demand by Sinn Fein, the leading nationalist party, to step down over corruption allegations, leading to the collapse of the regional government.

The D.U.P. also has a history of close ties to Ulster’s loyalist paramilitary gangs, who were responsible for terrorist atrocities against Irish Catholic civilians.

Those militant groups were supposed to have disbanded after the peace accord was signed in 1998, but they continue to exist and have been involved in gangland-style killings as recently as last month.

The party’s leader, Foster, even met last week with the head of the Ulster Defence Association, just days after the U.D.A. was implicated in a brutal murder in a supermarket car park, believed to be part of a feud between rival factions.

Given that the vicious tabloid campaign to smear Jeremy Corbyn as an “apologist for terror,” focused on his supposed failure to condemn the I.R.A. in strong enough terms, it will be interesting to see how those same newspapers now present May’s deal with the political allies of Ulster militants as perfectly acceptable.

Add to all this the fact that, as the Northern Irish journalist Siobhan Fenton explains, “Northern Ireland’s peace process risks being destabilised by the coalition.”

“In the aftermath of the Troubles, British governments are required to be neutral towards Northern Irish parties and not pick ‘sides,'” Fenton notes. “With a D.U.P.-Conservative coalition, it is difficult to see how the Tories can claim to be a neutral broker on Northern Irish issues anymore.”

That’s particularly bad at the moment, since Northern Ireland’s local government is not functioning and the British and Irish governments are supposed to work as honest brokers to help resolve conflicts between the two communities.

Should May’s government survive throughout the Brexit negotiations — another election is certainly possible, as is an internal challenge to her leadership — cooperation with the Ulster Unionists will also put the focus on how the deal might effect the currently open border between the Republic of Ireland, which is staying in the E.U., and Northern Ireland, which will leave with the rest of the U.K.

The election results were May’s reward for running what was widely described as a dismal campaign, in which she promised an austere future marked by further cuts to social services and police numbers, and threatened to pull the U.K. from the European Union with no trade agreement at all if necessary to satisfy Brexit fanatics. She also, to no apparent profit, raised the possibility of lifting the ban on fox hunting, which appears to have cost her votes.

That the Conservatives lost at least a dozen seats, and Labour gained at least 29, was a stunning reversal from the expected outcome just seven weeks ago, when May called the election three years early because of a commanding lead in opinion polls that showed her more than 20 points ahead of the opposition leader Jeremy Corbyn’s Labour Party.

Although the Conservatives won at least 57 more seats than Labour, their final advantage in the popular vote was just two percentage points: 42-40.

Given the unbridled hostility of Britain’s right-wing tabloids for Corbyn, and a lack of support from the more centrist members of his party, Labour’s strong second on a boldly left-wing platform — promising free university tuition and better funding for the National Health Service — was a remarkable showing.

It was also made possible, at least in part, by a media law that compels British broadcasters to give genuinely fair and balanced coverage to major parties during election campaigns. For the past seven weeks, while the nation’s newspapers have been filled with anti-Corbyn invective, and the Conservatives flooded Facebook feeds with misleading video of his remarks about the I.R.A., television coverage of the campaign gave airtime to discussions of Labour’s policy proposals, which proved to be broadly popular.

While detailed estimates of the turnout by age are not yet available, many pollsters concluded that Corbyn’s campaign had inspired young voters, who overwhelmingly support him, to go to the polls in greater numbers than usual — upsetting turnout models that expected a Conservative win based on an older electorate.

Top photo: Britain’s Prime Minister and leader of the Conservative Party Theresa May returns to 10 Downing Street in central London on June 9, 2017.