WASHINGTON — President Trump expressed optimism Thursday about reaching a landmark trade deal with China, but said in an interview that he would consider leaving in place some tariffs on Chinese goods even if the two sides strike an agreement.

“Without the tariffs, we wouldn’t be talking,” Mr. Trump said in an interview with The New York Times, shortly after his administration concluded two days of high-level trade talks with Chinese officials. “And I make this point clear to them.”

As he hosted the Chinese delegation in the Oval Office earlier in the day, Mr. Trump said he would meet next month with the Chinese president, Xi Jinping. He suggested that Mr. Xi was prepared to make significant changes to Beijing’s economic policies, including opening its market to American companies and buying more products.

To buttress his point, Mr. Trump had a letter from Mr. Xi — filled with flattery of Mr. Trump and promises to make big purchases of American agricultural products — read aloud to reporters. Liu He, China’s vice premier and Beijing’s trade negotiator, told the president that Mr. Xi was committed to buying five million tons of soybeans, a pledge that caught Mr. Trump’s aides by surprise.

“It’s a very short period of time for a deal this big. But it’s very possible,” Mr. Trump said in the interview with The Times. “I believe that a lot of the biggest points are going to be agreed to by me and him.”

The United States wants China to commit to buying American goods and services in large quantities to reduce America’s trade deficit, and to agree to make structural changes, including ending its practice of requiring American companies to hand over trade secrets as a condition of doing business there.

The surprise Chinese offer to buy soybeans attested to their gamesmanship and attempt to sway Mr. Trump with big numbers. It also left Mr. Lighthizer and his colleague, Larry Kudlow, the chief economic adviser, flummoxed during a briefing with reporters about whether the Chinese had pledged to buy five million tons of soybeans, or the more commonly used bushels.

After Mr. Lighthizer dispatched an aide to seek clarification, the White House confirmed that the Chinese offer was to buy five million tons.

An economist at the American Farm Bureau noted that in a normal year the United States exports about 35 million tons of soybeans to China, so the five million ton purchase is not as robust a gesture as Mr. Trump suggested.

The world’s two largest economies have been locked in a monthslong standoff that has begun to slow global economic growth and rattled financial markets. Both countries are under increasing pressure to reach an accord: American companies with exposure to China have begun warning that the trade war is hurting profits, and the Chinese economy is growing at its slowest pace in years.

On Wednesday, Mr. Liu and the Chinese delegation began two days of talks with Mr. Lighthizer and Steven Mnuchin, the Treasury secretary. Mr. Trump said on Thursday that Mr. Mnuchin and Mr. Lighthizer would travel to Beijing in February, after the Chinese New Year holiday, to lay the groundwork for a meeting between the two presidents. One of the biggest issues to resolve, Mr. Lighthizer said, is how to ensure any commitment by the Chinese is enforceable.