WASHINGTON—A little over a year after withdrawing the U.S. from the Trans-Pacific Partnership, President Donald Trump has asked his top economic advisers to study the possibility of re-entering the trade pact negotiations.

Mr. Trump has deputized Robert Lighthizer, the U.S. trade representative, and Larry Kudlow, the director of the National Economic Council, to study the possibility of re-entering the TPP if the terms were favorable, the president told a group of lawmakers on Thursday.

The president’s new openness toward the TPP, which he had said during his campaign was a deal “pushed by special interests who want to rape our country,” comes as he is facing criticism from farmers and looking for allies in his escalating trade battle with China. Beijing had long feared that Washington would use the TPP, envisioned as having 12 members, as a way to try to contain China economically.

“You can explain this initiative entirely in the context of U.S-China relations,” said Gary Hufbauer, a trade specialist at the Peterson Institute for International Economics. “Trump has got to get some allies. As of now (China’s President) Xi has the upper hand in world opinion.”

In a late-night tweet, Mr. Trump set a high bar for success in any revived TPP talks, saying the U.S. would “only join TPP if the deal were substantially better than the deal offered to Pres. Obama.” He said the U.S. already has two-way trade deals with six TPP nations, and would continue pushing for one with Japan.