SIX months ago the cognoscenti of Turtle Bay, the UN’s location on the east side of Manhattan, were pretty sure that the next head of the nearest thing to a world government would—for the first time on two counts—be an east European and a woman, quite likely the one who runs UNESCO, the UN’s education and culture agency. Instead, it will be a 67-year-old man, who was a social-democratic prime minister of Portugal from 1995 to 2002 and then head of the UN’s refugee body for a decade from 2005. A second Bulgarian candidate, also a woman, but with a rosier reputation as a punchy ex-dissident than her ex-communist compatriot, caused a momentary frisson of gamblers’ excitement by throwing her fur cap into the ring at the last minute. But she was too late and too controversial. António Guterres, who will succeed Ban Ki-moon at the year’s end, has been welcomed across the global board.

The final decision, as ever, depended on the White House and the Kremlin agreeing not to block each other’s favourite (or most unobjectionable) candidate. The surprise was that Mr Guterres so swiftly won the acquiescence of both superpowers, even though relations between the two are probably at their grumpiest since the end of the cold war. It has been surmised that Mr Guterres, as part of a back-room bargain, will appoint a Slav, indeed maybe a Bulgarian, as his deputy.

His victory was partly thanks to the novel, relative openness of the competition. In the past the choice had been made entirely behind closed doors, with no candidates openly declaring themselves. This time, starting in April, a series of public hearings before the UN General Assembly was followed by a string of straw polls among the 15 countries represented in the UN Security Council, each one anonymously suggesting which of the candidates should be “encouraged” or “discouraged”, or neither. But in the sixth and final straw poll, the five permanent members of the council (America, Britain, China, France and Russia), each having the power to block any candidate, were to cast coloured ballots, signifying their veto-wielding status. Mr Guterres had easily topped each of the first five polls. In the final poll he again far outshone his opponents, with no country casting a negative ballot, which meant that the superpowers had all agreed to embrace him.

Various candidates had been thought to have a chance, backed by a superpower sponsor. But none seemed to match Mr Guterres’s qualities. He won respect as prime minister of a notable if currently beleaguered country and as an adroit international operator; as head of one of the UN’s most essential bodies, he understands the inner workings of the vast and cumbersome UN bureaucracy. He is multilingual and articulate. Moreover, he is universally considered decent and able, pragmatic and principled, affable but steely. He knows how to communicate to the world and knock powerful heads together.

Mr Guterres “will take charge of an organisation close to political bankruptcy,” says Richard Gowan, a UN expert at New York’s Columbia University. The Syrian catastrophe, he says, marks “the worst institutional crisis the Security Council has seen since the Iraq war”. Yet the secretary-general is a cajoler and fixer, not a global boss. He is “not a politician with an election victory under [his] belt but a civil servant with 193 stroppy masters”, says Lord (Mark) Malloch-Brown, a Briton who was once the UN’s deputy head. The secretary-general is also an accountant, overseeing a budget for an array of UN bodies that often compete more than they co-operate.

Mr Guterres must fortify the UN’s three main pillars: economic development (especially for the poor); human rights; and making and keeping the peace. This last is the biggest and trickiest: witness Syria. However feeble the UN can seem, it is still the global body with by far the widest reach and heaviest weight. With 100,000-plus blue-helmeted soldiers and police on a score of missions across the world, it has easily the biggest capacity as a neutral arbiter for stopping death and destruction. Preventing wars before they happen will inevitably be Mr Guterres’s intention. More often he will have to pick up the pieces after disaster has struck.

His first task will be to recapture the UN’s primacy in world security—devilishly hard when America and Russia are at loggerheads. The crises in Yemen, Libya and South Sudan, as well as in Syria, need his urgent attention. He will have no time to catch his breath.