The secretary general stopped short of calling Mr. Trump’s executive order illegal under international law. But asked whether it violates international obligations, he said: “I think that those measures indeed violate our basic principles. And I think that they are not effective if the objective is to really avoid terrorists to enter the United States.”

Mr. Guterres is under enormous pressure. On the one hand, he must speak out against discrimination, in keeping with the rules enshrined in international conventions. On the other, he needs to avoid alienating the president of the United States, which is the United Nations’ biggest financial backer.

Mr. Guterres declined to comment about the White House’s reported threats to cut financial support to the United Nations, saying he did not want to prejudge what has not yet been announced. “When you talk too much about things that have not happened, you trigger the happening of those things,” he said.

He said he had held “a very constructive discussion” with the new United States ambassador to the United Nations, Nikki R. Haley.

“What I am doing is to do everything I can to prove the added value of the U.N., to recognize the U.N. needs reforms, to be totally committed to those reforms,” Mr. Guterres said.