“Today we have reached an agreement with the Conservative Party on support for government in parliament,” DUP leader Arlene Foster said in Downing Street.

Northern Ireland's Democratic Unionist Party (DUP) said on Monday it would support Prime Minister Theresa May's government on legislation concerning Britain's exit from the European Union, securing her a slender majority in parliament.

Ms. May struck a deal with the DUP on Monday to back her administration after she failed to secure an outright victory in the June 8 snap election. The Conservatives have 317 seats in the 650-seat parliament after the election and need the support of the DUP's 10 MPs to be able to govern.

“The DUP... agrees to support the government on legislation pertaining to the United Kingdom's exit from the European Union; and legislation pertaining to national security,” a document published by Ms. May's office said.

Also Read PM May nears DUP deal

The agreement was signed in Ms. May's Downing Street office after more than two weeks of negotiations. Under the terms of the deal, Northern Ireland will receive an extra £1.0 billion from the State over two years in exchange for DUP supporting the Conservatives.

The deal with the DUP will prove controversial because of the party's opposition to gay marriage and abortion and concern that an agreement could upset the fragile balance of the peace process in Northern Ireland.

The deal is a "confidence and supply agreement", meaning that the DUP will only guarantee to support the Conservatives in confidence and budget votes.

For any other measures support would be on a vote-by-vote basis, the text of the agreement said.

"I welcome this agreement which will enable us to work together in the interests of the whole United Kingdom," Ms. May said in a statement.

'Shoddy little deal'

Ms. Foster said, "This agreement will operate to deliver a stable government in the United Kingdom's national interest at this vital time."

The DUP supported Brexit but has emphasised the need to keep the border with the Irish republic open, and Ms. Foster said the deal would back a Brexit process "that supports all parts of the United Kingdom".

Ms. Foster said the extra money would be spent on infrastructure, health and education, benefiting the whole of Northern Ireland after concerns voiced by the republican Sinn Fein party, the DUP's rivals.

The deal will face its first test in parliament with a confidence vote expected on Thursday.

The main opposition Labour Party has said it will push for another general election.

Liberal Democrat leader Tim Farron immediately slammed the agreement as a "shoddy little deal".

"The nasty party is back, propped up by the DUP," he said in a statement.