GENEVA — In a surprise compromise, the top United Nations human rights body decided on Friday to establish an international team of experts to examine abuses in the Yemen war and seek to identify those responsible.

The decision capped an intense spate of diplomacy that spared Saudi Arabia, which has led a deadly bombing campaign in Yemen for more than two years, from a formal panel of inquiry like the one investigating the war in Syria.

The 47-member Human Rights Council in Geneva adopted the decision by consensus after three weeks of day-and-night negotiations over one of its most fiercely contested resolutions.

The final version calls for the United Nations high commissioner for human rights, Zeid Ra’ad al-Hussein, to appoint “a group of eminent international and regional experts” to conduct a “comprehensive examination” of abuses by all parties to the conflict since September 2014.