Britain and the European Union failed Monday to reach a Brexit divorce deal, but their leaders remained optimistic that they would reach an accord within days.

British Prime Minister Theresa May and European Commission President Jean-Claude Juncker met in Brussels, trying to set terms for Britain's exit from the EU on March 29, 2019.

They had previously agreed that Britain would pay somewhere between $51 billion and $63 billion to leave the 28-nation pact. But they have yet to agree on other complex issues, including whether British-governed Northern Ireland would continue to have single market rules within the EU, under what terms could people cross the border between Northern Ireland and Ireland and what the rights would three million Europeans living in Britain have.

'Despite our best efforts and the significant progress we and our teams have made in the past days on the remaining withdrawal issues, it was not possible to reach a complete agreement today,' Juncker said at a news conference with May.

'This is not a failure...,' he said. 'I am very confident that we will reach an agreement in the course of this week.'

May said differences remained on a 'couple of issues. But we will reconvene before the end of the week, and I am also confident we will conclude this positively.'

The Irish broadcaster RTE said Britain was prepared to let Northern Ireland keep EU customs provisions and single market rules with the EU, to meet Ireland's demand that Britain's departure from the EU would not result in a 'hard border' with Northern Ireland.

But Northern Irish unionists objected, with party leader Arlene Foster saying, "We will not accept any form of regulatory divergence which separates Northern Ireland economically or politically from the rest of the United Kingdom."

Conversely, if Northern Ireland is granted special treatment, the leaders of Scotland, Wales and the mayor of London said they also wanted a similar deal with the EU.