BRUSSELS — The European Union is considering stepping up its legal action against Britain over legislation that would breach parts of the legally binding Brexit agreement that the EU and the British government reached late last year.

The fight over the government's proposed bill continued Tuesday as the two sides were deep in negotiations on a free trade agreement. A trade deal must reached within weeks for it to be in place on Jan 1, when an 11-month Brexit transition period ends.

"This dispute will have to be resolved," EU spokesman Daniel Ferrie said.

A legal fight on top of the negotiations only highlights how bruising Britain's withdrawal from the European Union has proven to be. The 27-nation bloc said it could now move to a second phase in the dispute over the U.K. Internal Market bill following Britain's refusal to reply to an Oct. 1 legal request seeking an explanation for its actions,

EU leaders fear that if the U.K. bill becomes law, it could lead to the reimposition of a hard land border between Northern Ireland, which is part of Britain, and EU member Ireland. The border was heavily militarized during the decades of sectarian violence in Northern Ireland, and the free movement of people and goods across it is viewed as essential to upholding the 1998 Good Friday peace accord.

There are hopes that the legal fight would become obsolete if both sides agree on a trade deal. But despite months of talks, substantive disagreements remain.

Britain wants to retain as many of the advantages of EU membership as possible without have to live by the bloc's rules. The EU is insisting on stringent trade regulations to avoid having a giant buccaneering trade partner on its doorstep that could freely undercut the bloc's state aid, social and environmental standards.

"There is obviously a lot of work to be done," Ferrie said.

Hundreds of thousands of jobs are at stake on both sides, especially in nations close to Britain such as France, Belgium and the Netherlands.