WASHINGTON — The Trump administration considered severely penalizing El Salvador this month for severing diplomatic ties with Taiwan in a move that officials said was intended to signal a significant widening of the administration’s pushback against China.

The effort ultimately fizzled over concerns that the penalties — eliminating some foreign aid and imposing visa restrictions on certain individuals — would have made El Salvador unwilling to help stop the flow of illegal immigrants to the United States.

The threat set off a furious internal debate between the White House and State Department, and pit American diplomats focused on China against those working on issues in the Western Hemisphere. It also displayed the administration’s determination to challenge China beyond a growing trade war, even before it settles on a clear strategy.

At the United Nations on Tuesday, President Trump announced the State Department would undertake a thorough review of foreign aid, giving it only “to those who respect us and, frankly, are our friends.”