By Laurence Norman

BRUSSELS -- The U.K. and European Union are on the verge of reaching a post-Brexit trade accord, a few days before the deadline, cementing a deal that would end more than four years of uncertainty about future relations between major U.S. allies.

At stake are the terms for around $900 billion in trade between Britain and the EU and the depth of their cooperation on law enforcement and counterterrorism, among other issues.

"We are in the end phase now," said an EU official. Another diplomat said an agreement was very close.

People familiar with the talks said negotiators are going through the fine print of the accord. Shortly after midnight local time, the European Commission's chief spokesman said discussions would continue through the night with news possible early Thursday morning.

A deal, just days before the Dec. 31 deadline, would calm the worst fears of a major economic disruption in coming weeks as Britain unmoors from its largest trading partner. It would mean tariff-free trade between the two sides and reduce -- but not eliminate -- the need for many new customs and regulatory formalities at the border.

It would follow months of tense negotiations and set out the terms of a much more distant relationship between Britain and the EU than at present.

It would mark the capstone of the Brexit project, ending years of uncertainty over how tightly Britain will remain entwined with the EU after it voted to leave the bloc in June 2016.

A deal would give Britain significant freedom to depart from EU regulations and to sign free-trade deals with countries like the U.S. But as the price for securing a deal without tariffs, the U.K. is expected to commit not to seriously undercut EU norms on issues such as labor and environmental standards and to roughly equivalent rules on limiting government support for private companies.

Britain formally left the EU on Jan. 31 but will remain in the bloc's single market and customs union until year's end. Failure to reach a deal would mean that from Jan. 1, tariffs would be applied for the first time in almost a half-century on some trade between the U.K. and the EU. The U.K. sends 43% of its exports to the bloc.

Any deal will need signoff from EU capitals, as well as the U.K. and European parliaments. EU diplomats have said the bloc's leaders will want enough time to scour through the text over the next few days before signing off.

The U.K. Parliament could meet before the end of the month, but the European Parliament has said it can no longer meet this year to vote on any accord. That means an agreement may have to be adopted provisionally by EU governments until EU lawmakers can vote on it in the new year.

The rights of EU fishing boats to access U.K. waters from 2021 have dominated the latest phase of talks. While fishing has minor economic significance -- affecting overall some EUR600 million, equivalent to around $730 million, annually of fish caught by EU boats in British waters -- it is politically sensitive in the U.K. and EU coastal states including France, Belgium and the Netherlands.

Over the past week, both sides have suggested and rejected compromises, with U.K. Prime Minister Boris Johnson having spoken with European Commission President Ursula von der Leyen several times over recent days to try to craft a deal.

The differences finally narrowed to a fraction of the total catch. The EU has proposed guaranteeing U.K. fishing boats a higher share of fish caught in British waters in future with a six-year transition to the new rules, diplomats say. It also wants the power to impose tariffs on U.K. fish exports if Britain decides in future to lock its fishing boats out of U.K. waters.

The U.K. said that wasn't enough and wanted to lock in a bigger increase, with a three-year transition.

The British pound rallied on Wednesday following news of the potential deal, gaining 1.1% against the dollar and 0.8% against the euro. Investors have expected that an agreement would remove some uncertainties surrounding trade after the new year.

"We've got that relief rally off the fact there is a deal and the downside risk is removed," said Simon Harvey, currency analyst at broker Monex Europe.

Most of the text of the proposed accord, which runs to well over 1,000 pages, has been agreed on. The deal is structured around an agreement to maintain zero-tariff, zero-quota trade but covers everything from the EU law-enforcement databases that the U.K. will continue to access to the rights of airlines to serve EU markets.

The toughest issue during the eight-month negotiations -- the EU demand that the U.K. ensures fair competition in future by not slashing its state-aid, labor or environmental rules -- has largely been resolved, although there has been continued discussion over how the rules will apply in some sectors.

If there is no final agreement in the next 24 hours, talks are likely to resume after Christmas.

With negotiators having kept the detailed text largely to themselves, EU member states say they need enough time to scrutinize any deal, prompting a warning from chief negotiator Michel Barnier, diplomats say, that an agreement may not be sealed by Jan. 1.

Write to Laurence Norman at laurence.norman@wsj.com

(END) Dow Jones Newswires

12-23-20 1940ET