WASHINGTON — One of Donald Trump’s first acts as president was to pull the United States out of the Trans-Pacific Partnership, the 12-nation free-trade deal that President Obama negotiated but left unfinished.

Trump derided the pact as a bad deal for America. But leaving it hasn’t turned out that well either.

The remaining 11 members proceeded anyway, slashing tariffs and leaving U.S. businesses at a significant competitive disadvantage. In particular, American exports of grains, meats and other farm goods to Japan — by far the biggest of those 11 economies — have taken a hit.

Now the White House is scrambling to undo the damage of Trump’s swift withdrawal from what would have been the world’s largest regional trade agreement.

Japanese Prime Minister Shinzo Abe arrives Friday in Washington to meet with Trump. At the top of the administration’s agenda are trade talks to level the playing field for the United States.

While Trump was busy slapping tariffs on China and other countries, Japan also concluded a pact with the European Union that lowered duties and other barriers to ease trade flows. Between the EU and Asia-Pacific, Japan is now starting to import substantially more from its free-trade partners, at America’s expense. That’s bad for U.S. farmers who were already reeling from tit-for-tat tariffs on soybeans and other farm goods entering China.

“Give us some relief. We’re not surviving the way it is,” said Greg Svenningsen, 60, a North Dakota farmer who’s seen the cash price for his wheat plunge 25% since last fall, because of slumping demand from Japan and other Pacific buyers.

For some products, the difference in tariffs is stark. Australian wine entering Japan is taxed at 5.6% and will eventually drop to zero. There’s no duty at all for wine from the EU and Chile. But for California, it’s 15%.

That’s pinched the U.S. share of imported wine in Japan, and the pain is likely to get worse.

Hiro Tejima of the Wine Institute’s Japan program says the EU-Japan accord is opening up more opportunities for European wine. Italy, the third-largest wine exporter to Japan, recently signed a deal to promote Italian bottles at 10,000 supermarkets in Japan. American wine ranks fourth among imports in Japan, with France and Chile at the top two spots.

“U.S. exporters of wheat, beef, pork, dairy, wine, potatoes, fruits and vegetables and other products are facing collapse of their Japanese market share as these lucrative sales are handed over to their competitors,” the Wine Institute and 87 other food and farm groups and companies said in a joint letter sent this week to Trump’s top trade official, Robert Lighthizer.

Lighthizer and the Japanese economic minister, Toshimitsu Motegi, launched the trade talks last week and were meeting again Thursday ahead of Abe’s visit with Trump.

The opening of trade negotiations poses new challenges for Abe, who has worked hard to cultivate relations with Trump. The Japanese leader has twice visited Trump’s Mar-a-Lago resort in Florida and is preparing to meet Trump three times in as many months.

After this weekend in Washington, in which Abe will be joining a birthday celebration for First Lady Melania Trump, the Japanese leader is expected to host Trump in late May for an official state dinner in Tokyo where Trump will also greet Japan’s new emperor. And then the prime minister is to lead the Group of 20 major economies’ summit in Osaka in late June.

The Japanese plan has been “to get Abe in front of Trump, flood the zone and keep the president thinking about Japan and liking Abe on a personal level,” said Michael J. Green, senior vice president and Japan chair at the Center for Strategic and International Studies.

So far, Abe has avoided any big brushes with Trump, in part because the American president has been preoccupied with China. And one notable foreign policy achievement that Abe can point to is the Trump administration’s full embrace of Japan’s approach calling for a free and open Indo-Pacific, a recognition of the strategic links between the Indian Ocean region and the Western Pacific in light of China’s increasingly assertive and expansive activities.

At the same time, Trump himself has said little about how he might develop that strategy or about America’s broader role in the region.

The Trans-Pacific Partnership was supposed to be the linchpin of the Obama administration’s move to bind the region around an American-designed system of commerce and provide a counterweight to China’s rising influence. The deal was concluded but never found enough support in Congress, and Trump dumped the pact three days into office, saying it was a “great thing for the American worker what we just did.”

After the U.S. withdrawal, Abe played a key role in reviving it among the remaining 11 nations. That didn’t endear Abe to Trump. The president didn’t give Japan a break on steel tariffs. And at times he has publicly railed about Japan’s trade surplus with the United States.

Shige Watanabe, the Japanese Embassy’s economic minister in Washington, said Japan is prepared to provide the United States the same tariff rates that Tokyo negotiated with the EU and the 10 other Pacific Rim countries, which include Canada, Mexico and Vietnam. That should give some relief to American farmers, although it’s unclear how fast a deal can come together.

The two sides have not yet agreed on the scope of the trade negotiations.

The Trump administration will be asking for a lot more than tariff reductions on agriculture imports. The big fight will most likely be over cars.

Although Japanese companies are producing 3.7 million vehicles a year on U.S. soil — with some models having even higher domestic content than American brands — Japan’s auto trade accounts for the vast majority of the country’s $68-billion trade surplus in goods with the United States. (China’s merchandise trade surplus with the U.S. was $419 billion last year.)