U.S. President Donald Trump boards Air force One at Morristown Municipal Airport in Morristown, New Jersey on July 3, 2017 | Mandel Ngan/AFP via Getty Images Trump boosts free trade — outside the US Europe and Japan secure landmark deal that seemed a long shot before US president’s election.

Turns out U.S. President Donald Trump can make huge trade deals happen.

They just don't involve America.

Japan and the EU are the first economic powerhouses to jump onto the free-trade bandwagon in reaction to Trump pulling up the protectionist drawbridges in Washington. On Thursday, Japanese Prime Minister Shinzō Abe is set to sign a political agreement in Brussels on what would be the world's biggest free-trade deal, covering almost 30 percent of global economic output.

That is a massive turnaround from the past few years, when even some senior EU officials were ready not only to write off the Japan deal but even pen the obituary of the bloc's entire trade policy. Things hit rock bottom last October, when a supposedly easy deal with Canada looked set to be torpedoed by opposition in the Belgian regional parliament of Wallonia.

Exasperated by anti-trade rhetoric steering European politics, Ottawa's then-Trade Minister Chrystia Freeland fought back tears outside the Walloon assembly in Namur and questioned whether the EU was able to strike an accord with any country on earth if it could not deal with one "as kind, as patient" as Canada. The EU-Canada deal survived by a whisker but Europe's appetite for free trade appeared fatally shattered.

Then Trump happened, storming to electoral victory in November partly by playing to fear of free trade in Rust Belt states.

The EU-Canada deal survived by a whisker but Europe's appetite for free trade appeared fatally shattered. Then Trump happened.

The more Europe's ultimate bogeyman railed against free-trade deals, the easier they were to sell in the EU, Asia and Latin America.

“For quite some time, people thought that things would return to normality [after Trump's election],” said Ulrich Speck, a senior foreign policy analyst at the Elcano Royal Institute think tank. “Instead, the Trump shock is still there. This has created a whole new urgency for the EU and Japan.”

Catalyst for action

The newly found enthusiasm for a Japan deal owes almost everything to Trump. Over recent years, the Tokyo-Brussels agreement often seemed close to collapse, with Japan stubbornly reluctant to open its agricultural sector in return for greater access to Europe's car market.

Japan's priority instead was the Trans-Pacific Partnership with the U.S. and 10 other Pacific Rim states, but when Trump issued an order to pull out, it was clear to Japan's leaders the world had changed.

“There was a huge gap [between Tokyo and Brussels],” said André Sapir, a trade expert at the think tank Bruegel. “But then within a short time, it has been bridged. You needed the Trump effect to jump over that hurdle so remarkably fast.”

Before his departure for Brussels, Japan's Abe left no doubt about why he was pushing the deal so strongly and made an unambiguous reference to Trump. "It is important for us to wave the flag of free trade in response to global moves toward protectionism by quickly concluding the free-trade agreement with Europe," he told his ministers.

A senior EU official also agreed the deal “was probably helped by what we both see as a deterioration of the international climate” in terms of trade and investment.

Still smarting from the shock of the U.S. withdrawal from the Pacific deal, Abe visited European Commission President Jean-Claude Juncker in March to inject high-level political will into the talks and wrap them up before the summer.

An even more decisive meeting took place a few days earlier, when Abe met German Chancellor Angela Merkel. After that meeting, a resolute Merkel told reporters: “We want [the Japan deal] soon because that could be the right statement” in response to Trump's policies.

European diplomats close to the trade talks said Merkel instructed Juncker to deliver the Japan deal as soon as possible. The leader of Europe's economic powerhouse, which also hosts the G20 summit this Friday and Saturday in Hamburg, wants to use the Japan agreement as a direct rebuke to Trump.

“My aim is that the G20 summit sends out a strong signal for open markets and against protectionism,” Merkel told the German parliament last month.

Tokyo's tightrope

For Tokyo, negotiating a trade deal with Brussels was always a balancing act between economic interests and geostrategic concerns.

On the macroeconomic front, Japan's prime minister styled free trade and opening up the economy as a key part of his "Abenomics" reforms to haul the economy out of decades of stagnation. The Asian country also is keen to win better access to the European market for its car exports, particularly after its arch-rival South Korea won better terms for cars under a 2012 EU trade deal.

But Japan was prevented from leaping into closer ties with Europe by its military dependence on the U.S., particularly in terms of its desire for protection against an increasingly bellicose North Korea and Chinese naval expansion.

Abe was the first foreign leader to visit Trump after his election in November, and in February he cozied up again with the president by visiting his Mar-a-Lago resort in Florida to play golf. Tokyo was long unwilling to take Trump's opposition to TPP at face value.

On the trade front, this meant Japan had to tread a very precarious tightrope.

“The Japanese were worried about making far-reaching concessions [that the EU wants on dairy or meat imports] because of the implications this could have on U.S. demands,” said Petr Ježek, the chair of the European Parliament's delegation for relations with Japan. Slashing agriculture tariffs for both Brussels and Washington would be politically toxic in Japan, because the country's elderly and influential farmers fear they will be wiped out by a tide of international competition.

Trump's retreat on trade almost miraculously solved that impasse, Ježek said. “Now that it has become obvious that TPP — or any alternative trade deal with Washington — is put on the back burner for quite some time, it seems no longer a serious problem to move forward with Europe,” he said.

The political deal to be signed Thursday covers more than 90 percent of the issues, and EU officials will try to finalize the accord by January 2018.

In fact, one European diplomat said Japan was willing to offer Europe the same sort of agricultural access it had originally envisaged giving to the U.S. in TPP.

"The EU just walked in where the U.S. left," he said.

Not over yet

Despite the unexpectedly rapid political agreement, observers cautioned against premature triumphalism. Several noted that it was still too early to say whether the EU-Japan deal would really be spared the populist headwinds that rocked the Canada accord.

"We don't know yet how this trade deal will be ratified, [and] if regional parliaments could again threaten to block it," Bruegel's trade researcher Sapir said. Diplomatic sources in Brussels said the European Commission is working on a proposal to split trade deals into two — essentially carving out contentious clauses on investment — to prevent them from falling hostage to national and regional assemblies.

However, Sapir said the Trump effect has already caused many trade skeptics to question their rejection of such agreements. A recent poll showed that in Germany, the heartland of opposition to EU trade deals last year, support for globalization has gone up from 50 to 63 percent within the first six months of this year.

The political deal to be signed Thursday covers more than 90 percent of the issues under discussion and EU officials say they will try to finalize the accord by January 2018, while the Trump effect still boosts their cause.

Pedro Silva Pereira, the European Parliament's rapporteur on the Japan deal, called the trade agreement a "strategically and economically very important achievement." Still, he warned that both sides would now have to continue their close work in the coming months to wrap up everything by January.

"This is not the end of the road," he said.

Simon Marks and Jakob Hanke contributed reporting.