(Bloomberg) -- Japan’s parliament approved a trade pact with the U.S. that opens the country’s markets to American beef and other agricultural products, as Tokyo tries to thwart a threat from Donald Trump to impose new tariffs on its lucrative car exports.

The deal cleared a last hurdle with approval from Japan’s upper house on Wednesday, clearing the last hurdle. The U.S. has been pressing for the agreement to come into force by Jan. 1, which could help Trump land votes for his 2020 re-election campaign in agricultural areas that may benefit from the deal.

Prime Minister Shinzo Abe’s ruling Liberal Democratic Party coalition holds majorities in both houses of parliament and was able to win passage easily. The deal has nevertheless been criticized by opposition lawmakers, who say it gives away bargaining chips without a written guarantee that Trump won’t impose so-called national security tariffs as high as 25% on the country’s auto sector.

Trump was eager to make a deal with Japan to appease U.S. farmers whose access to the Chinese market has been constrained as a result of his trade war with Beijing. American agricultural producers, also reeling from bad weather and low commodity prices, are a core component of Trump’s political base.

The threat of punitive tariffs on the exports of cars and car parts, a $50 billion-a-year sector that is a cornerstone of the Japanese economy, pushed Abe to accept two-way trade talks with the U.S. after he failed to persuade Trump to return to a Pacific pact he had rejected.

Abe has said Trump assured him when they met in New York in September that he wouldn’t impose fresh tariffs. Under the current deal, Japan is set to lower or abolish tariffs on U.S. beef, pork, wheat and wine, while maintaining protection for its rice farmers. The U.S. will remove duties on Japanese exports of some industrial parts.

Where U.S.-Japan Trade Talks Have Led and Are Going: QuickTake

A second pact that was approved simultaneously aims to provide a legal foundation for smooth digital trade between the world’s largest and third-largest economies. It bans both countries from imposing tariffs on products distributed electronically, such as software and games.

Japan’s Cabinet Secretariat calculated that the two-way deal would bolster its real gross domestic product by 0.8%, but its calculations were based on the assumption that existing tariffs on Japanese car exports to the U.S. would be removed. Domestic agricultural production was set to fall by between 60 billion-110 billion yen ($552 million-$1 billion), according to the same calculations.

The two sides are set to enter preliminary talks on a second round of trade negotiations after the deal goes into force, with Japan saying it still hopes to get existing car tariffs removed.

--With assistance from Isabel Reynolds.

To contact the reporter on this story: Jon Herskovitz in Tokyo at jherskovitz@bloomberg.net

To contact the editors responsible for this story: Brendan Scott at bscott66@bloomberg.net, Jon Herskovitz

©2019 Bloomberg L.P.