THIS has been a good week for anybody who still hopes that most of the world's nations can be induced to sign up to certain standards of decent behaviour—and then to keep their promises. Libya's despot, Muammar Qaddafi, can take the credit.

Whether they were motivated by real outrage over Colonel Qaddafi's deeds or just feared being on the wrong side of history, countries of all ideological hues have shown remarkable unity in condemning and isolating the Libyan regime. On February 25th the Human Rights Council (HRC), a United Nations (UN) body on which a rotating group of 47 countries have seats, proposed that the Libyan government be ejected from its ranks. On March 1st the UN General Assembly—which, to the horror of many, had elected Libya to the council last May—duly reversed itself and agreed without a vote to the expulsion. The only loud dissenter was Venezuela, whose envoy urged America and its allies to call off “invasion plans against Libya”.

Such near-unanimity came as a surprise to those who dismiss the assembly as a dictators' club and the rights council as deeply flawed. Such critics cite the council's relentless condemnations of Israel and its cavalier attitude to free speech. Even the American ambassador to the council, Eileen Donahoe, looked delighted as she emerged from the Geneva vote: she had expected a bruising debate, but the anti-Qaddafi motion had sailed through. Her boss, Hillary Clinton, also purred with pleasure when she came to Switzerland a few days later. The secretary of state said that in the Libya vote “we saw this council at its best”—although she added that the institution had plenty of shortcomings.

There was another pleasant surprise for liberal idealists on February 26th, when the UN Security Council unanimously agreed (along with other punitive measures) to tell the prosecutor of the International Criminal Court (ICC) to probe the Libyan crisis. For Russia and China, voting in favour of such a motion went against the grain. Although they allowed the ICC, in 2005, to investigate Sudan, many people believed that all subsequent efforts to send dictators to court would be resisted in Moscow and Beijing. According to Richard Dicker of Human Rights Watch, the 15-0 vote to punish and probe Libya was a vindication of the ICC's ideal: curbing crimes that “shock the conscience” of mankind.

The breadth of the anti-Qaddafi coalition is also a blessing for Barack Obama. He has taken political risks by re-engaging with the HRC—a body which the Bush administration thought too dreadful to touch—and by working with the ICC, even though America has yet to join the court.

But how many more happy surprises can be expected from the council? Given that it also counts Angola, Malaysia, Thailand and Uganda—hardly paragons of civil liberty—among its current members, disappointments may be more likely. Last week, while most people's minds were on Libya, the HRC fluffed a chance to clean up its act. After a review of its own record since it was created five years ago, the council produced a document that dashed hopes of change. Moves to give a freer hand to the UN High Commissioner on Human Rights—a job now held by Navi Pillay, a South African judge—had been blocked. Peter Splinter of Amnesty International, an advocacy group, compared the review process to an “elephant giving birth to a cockroach”.

Meanwhile UN Watch, a lobby group that counters UN criticism of Israel, has gleefully recalled the fulsome praise for Libya that many council members offered when that country was undergoing a review of its performance a few months ago. Iran had “noted with appreciation” the Libyan government's new human-rights agency and its “enabling environment for NGOs”; Syria was impressed by Libya's “democratic regime based on promoting the people's authority”; and North Korea lauded Libya's achievements “in the protection of human rights, especially…economic and social rights.”

Unless something is done to interrupt the review of Libya, all these warm words, along with much harsher comments from the West, will find their way into a report due for consideration this month. Also imminent is a decision on whether to name a special rapporteur to look into human-rights abuses in Iran. Some delegations are resisting this move, arguing that governments should not be singled out against their will. Standing up to Iran may carry a higher price than kicking Colonel Qaddafi when he's almost down.