The president met with his economic advisers on Thursday as the United States and China moved closer to finishing a trade pact.

WASHINGTON — The United States has settled on final terms of a partial trade deal with China, several people familiar with the negotiations said, a development that could ease tensions between the world’s largest economies just days before the long-running trade war is set to escalate.

President Trump met with his top economic advisers Thursday afternoon at the White House, where the president agreed to significant reductions on tariffs he has placed on $360 billion of Chinese goods in return for China’s commitment to purchase American farm products and make other concessions, the people said.

As part of the agreement, the president is expected to announce that he will delay or cancel tariffs on $160 billion of consumer products from China that are scheduled to go into effect on Sunday. Those additional tariffs would have resulted in the United States taxing nearly everything China ships into the United States and foregoing them would prevent another escalation in a trade fight that has inflicted economic damage on both sides of the Pacific.

Mr. Trump said on Twitter on Thursday morning that the United States was closing in on a deal.

“Getting VERY close to a BIG DEAL with China. They want it, and so do we!” the president wrote.

Mr. Trump is expected to make an official policy announcement on Friday about progress toward a trade deal he initially announced in October. However, both sides have said before that they were on the verge of an agreement, only for the talks to collapse. The text of the agreement has not been finished and it is unclear whether China has agreed to all of the details included in the plan.

Michael Pillsbury, a China scholar at the Hudson Institute who advises the White House on trade, said that he had spoken to the president on Thursday afternoon about the agreement.

“This is a historic breakthrough,” Mr. Pillsbury said, attributing the agreement to the strong relationship between Mr. Trump and his Chinese counterpart, President Xi Jinping.

Mr. Pillsbury said that Mr. Trump was agreeing to roll back some of the tariffs he had imposed on China in exchange for Beijing bolstering its annual purchases of American products to about $50 billion next year. As part of the pact, Mr. Pillsbury said, China would also enforce stronger protections for American intellectual property, open its markets to American financial institutions and commit to greater transparency surrounding the management of its currency.

An agreement would come after 19 months of back and forth between the United States and China over trade practices that the president has criticized as unfair to American companies and workers. Mr. Trump, who campaigned on a promise to change the terms of trade in America’s favor, has spent the better part of two years punishing China with tariffs on machinery, chemicals, food, apparel and other products. China has retaliated with its own penalties, including cutting off purchases of American farm goods, like soybeans and pork.

Businesses across the globe have been hoping for a resolution that would help limit the damage from a fight that has pinched American farmers and manufacturers and contributed to slowing growth in China. An agreement with China would give the president something to promote on the campaign trail, along with a North American trade deal that was completed this week.

The deal under consideration would not resolve all of Mr. Trump’s issues with China. That includes China’s history of coercing technology away from American firms, as well as industrial policies that economists say have helped China dominate global industries like steel and solar panels and put American companies out of business.

Mr. Pillsbury said those concerns would be addressed in subsequent negotiations after the 2020 election.

The Chinese Embassy in Washington directed inquiries to the Ministry of Commerce in Beijing.

Stocks rose to a record on Thursday, with the S&P 500 gaining nearly 0.9 percent, and the yield on the 10-year Treasury note touched 1.91 percent, the highest level in almost a month. Asian markets continued the rally on Friday morning, with stocks rising in Hong Kong and Shanghai.

The American benchmark has been trading in record territory as investors anticipate a de-escalation of the trade war, and amid signs that the domestic economy is holding up.

“We’re encouraged that China and the United States seem on the verge of a breakthrough on the Phase 1 negotiations,” said Myron Brilliant, the executive vice president of the U.S. Chamber of Commerce. “If accurate, it would be a positive first step in improving our commercial relationship at a time of great uncertainty.”

But the backlash from China skeptics started even before any official announcement had been made.

Senator Marco Rubio, Republican of Florida, tweeted that the White House “should consider the risk that a near-term deal with #China would give away the tariff leverage needed for a broader agreement on the issues that matter the most.”

On Thursday, three powerful Senate Democrats, including Chuck Schumer of New York, sent a letter to Mr. Trump, warning that any first-phase deal that did not include meaningful changes to the way China structured its economy would be “a severe and unacceptable loss for the American people.”

Some mocked the president for solving a crisis of his own making.

“China Phase-1 deal is the equivalent of a gunman, who had taken hostages, surrendering to authorities, with no one killed, but his manifesto never published,” Jorge Guajardo, the former Mexican ambassador to China, tweeted. “No harm done to anyone, back to normalcy, madman contained, but the shopping mall lost a lot a customers during standoff.”

For a year and a half, Mr. Trump has alternated between praising China and ratcheting up tariffs on the country as he tried to press Beijing for trade concessions. In October, Mr. Trump announced that the United States and China had reached an agreement in principle on the first phase of a trade deal. But in the weeks since, a concrete agreement proved elusive as the two countries grappled over its precise terms.

Chinese negotiators pushed their American counterparts to remove as many of the existing tariffs as possible, while the Trump administration pressed China to make more purchases of soybeans, poultry and other goods to help relieve the pressure the trade war had put on American farmers. Mr. Trump also wants China to buy more American products to help narrow the trade gap between what the United States sells to China and what it imports.

To ensure that China keeps its commitments, the Trump administration has insisted on periodic reviews, as well as an agreement that China’s agricultural purchases would not drop below a certain amount. If China violates the terms of the agreement, tariffs that the Trump administration had removed would snap back into place.

China has been willing to discuss purchases of American agriculture, especially since a disease has devastated its swine population and led to spiraling pork prices. But in previous discussions, Chinese negotiators had pushed back against promising set purchase amounts far into the future, saying such an arrangement could anger its trading partners and violate its commitment to the World Trade Organization to treat all members equally.

In recent months, American and Chinese officials have been locked in a contentious discussion of what proportion of American concerns about Chinese economic practices are being addressed in the Phase 1 deal, and whether a corresponding proportion of Mr. Trump’s tariffs should be rolled back. The Chinese had enumerated the American requests into a list of more than 100 items, and have argued that if they resolve half of them, then half of Mr. Trump’s existing tariffs should be removed.

Some American analysts have criticized the approach, saying a significant reduction could leave the United States with less leverage for the second- and third-phase discussions that are planned, in which even more difficult subjects like Chinese subsidies would be included. They also point to the depreciation this year in China’s currency, the renminbi, saying that drop would almost offset the effect of the tariffs.

But others say an across-the-board reduction in the rate of all existing tariffs does offer the Americans some advantages, including not having to pick and choose among industries that would receive tariff relief.

The last tranche of tariffs, scheduled to go into effect at 12:01 a.m. on Sunday, would extend levies to cover nearly every shoe, laptop and toy that the United States imports from China — a total of $539.5 billion of merchandise last year. Companies have been eagerly watching to see whether the administration would issue the official announcement that will stop those levies from going into effect.

Many of Mr. Trump’s advisers have been wary of increasing tariffs on China as negotiators from both sides are trying to reach agreement on the first phase of a trade deal. Still, the urge to delay the tariffs — or to reach a deal — has not been unanimous. Peter Navarro, Mr. Trump’s hawkish trade adviser, circulated a memo this week that makes the case for forging ahead with additional tariffs and delaying any deal until after the 2020 election.

On the Chinese side, Thursday’s agreement appears to be a big victory for the more nationalistic wing of the Chinese government, which has argued consistently that the Trump administration will back down a considerable extent on tariffs if Beijing stands firm.

Ana Swanson and Alan Rappeport reported from Washington, and Keith Bradsher from Beijing. Matt Phillips contributed reporting from New York.