UNITED NATIONS — The United Nations Security Council reached a surprisingly swift consensus Wednesday on its choice for the next secretary general of the United Nations: António Guterres, a former prime minister of Portugal.

Mr. Guterres, 67, who ran the United Nations refugee agency for 10 years, had been the clear front-runner for the last several months. That a deeply divided Security Council rallied around him was a clear signal that Russia and the West saw him as someone they could work with.

Thirteen candidates, including a record seven women, had vied for the job; two had dropped out.

“We have a clear favorite, and his name is António Guterres,” said Vitaly I. Churkin, the Russian ambassador to the United Nations, who is presiding over the Security Council this month.

Mr. Churkin made the announcement outside the Council’s chamber on Wednesday, flanked by his American counterpart, Samantha Power, in an unusual display of cooperation. The envoys of all the other members of the Council were also there, looking as if they, too, were surprised by their unity.