Mark Rutte, the long-serving Dutch prime minister, was formally named the new secretary general of NATO on Wednesday, putting an experienced, strongly pro-Ukraine leader with a reputation for conciliation at the head of the alliance.

Mr. Rutte, 57, will take over from Jens Stoltenberg on Oct. 1, at a difficult time for NATO in the face of Russia’s war against Ukraine and in the midst of a tight race for the American presidency that could bring Donald J. Trump, who disparages the alliance, back into power.

The decision, sealed by NATO ambassadors during a meeting at the 32-nation alliance’s headquarters in Brussels, removes a potentially contentious issue from the alliance’s 75th anniversary summit meeting next month in Washington.

President Biden and his NATO counterparts will formally welcome Mr. Rutte to their table at a summit, which begins on July 9.

Long a favorite of Mr. Biden for the post, Mr. Rutte served as the Dutch prime minister four times, for nearly 14 years, building complicated coalitions through debate and compromise. Those skills should serve him well in an alliance that works by consensus, where one country can block the intentions of the rest.

Mr. Rutte turned down Mr. Biden’s request that he seek the NATO job at least once before, forcing the alliance to extend Mr. Stoltenberg’s term for an extra year.