The United Kingdom and the European Union on Monday agreed on terms for the country’s exit from the bloc, The Guardian reported. The Theresa May government reached an agreement on Brexit after making a series of concessions to Brussels, where the European Union is headquartered, and accepting a “back stop” plan to keep Northern Ireland under European law and avoid a hard border with the Republic of Ireland.

May had earlier insisted that no British prime minister could agree to a pact that includes a proposition threatening “the constitutional integrity of the UK by creating a customs and regulatory border down the Irish Sea”.

Britain’s Brexit Secretary David Davis said both the UK and the European Union were committed to the joint report in its entirety. “In keeping with that commitment, we agree on the need to include legal text detailing the back stop solution for the border of Northern Ireland and Ireland in the withdrawal agreement that is acceptable to both sides,” he said. “But it remains our intention to achieve a partnership that is so close as to not require specific measures in relation to Northern Ireland.”

The transition period will last from March 29, 2019, to December 2020, the BBC reported. The European Union’s Brexit negotiator Michel Barnier said the two sides had also reached an agreement on the rights of 4.5 million European Union citizens who live in the UK and the 1.2 million British citizens who live in member nations of the European Union. Citizens of the European Union who arrive in the UK during the transition period will also be granted the same rights. This is contrary to May’s repeated statements that citizens arriving during the transition period would be treated differently than those already in the country.