LONDON – The United Kingdom (UK) Prime Minister Theresa May said she will lead a minority government backed by a small Northern Irish party after Thursday’s stunning election defeat that cost her Conservative Party its majority.

“I will now form a government,” May said in a speech outside her official residence at No. 10 Downing Street after meeting with Queen Elizabeth at Buckingham Palace on Friday. She said that she will work with Northern Ireland’s Democratic Unionist Party and that her government will lead the country forward at a “critical” time.

“What the country needs more than ever is certainty and having secured the largest number of votes and the greatest number of seats in the General Election it is clear that only the Conservative and Unionist party has the legitimacy and ability to provide that certainty by commanding a majority in the House of Commons,” she said, using the official name of her party. “As we do, we will continue to work with our friends and allies in the Democratic Unionist party in particular.”

May said that her government would lead the country through upcoming Brexit negotiations with the European Union, and that she will work to keep the country safe following the recent attacks in London and Manchester.

“Now let’s get to work,” she said before entering No. 10 Downing Street.

Her remarks made clear that she is planning to form a minority government with backing from the DUP — rather than entering a formal coalition with the party. If that plan becomes a reality, the DUP would not hold any ministerial posts, but provide support for the Conservative government, which would depend on DUP votes in order to hold on to power. It is still not clear what the DUP would get in return for its support.

“I certainly think that there will be contact made over the weekend, but I think it’s too soon to talk about what we’re going to do,” DUP leader Arlene Foster said, speaking to BBC Radio Ulster. “I think we need to wait and see.”

The DUP has close ties with the Conservatives, and it is in favor of the U.K.’s withdrawal from the European Union.

With nearly all votes counted, the Conservative Party has 318 seats, according to the BBC. That is short of the 326 needed for an overall majority –- and 12 fewer than when May called the election. The opposition Labour Party, led by Jeremy Corbyn, has 261 seats, the Scottish National Party has 35, and the Liberal Democrats 12. The Democratic Unionist Party won 10 seats. Together, the Conservatives and the DUP would have 328 seats in parliament, just above the 326 needed.

May called a snap election in April in what she said was an attempt to strengthen her mandate ahead of negotiations with the European Union about the British exit from the bloc. At the time, polls suggested her party would win with a big majority.

Instead, her strategy backfired as the election took away the Conservative majority and sent the country into political turmoil.

The stunning election result comes after a campaign in which May lost popularity over her style and some of her social care policies, including a so-called “dementia tax” that would force the elderly to pay more for their care.