UNITED NATIONS — Efforts by the Trump administration to marshal a muscular international response to Iran’s crackdown on anti-government protesters appeared to backfire on Friday, as members of the United Nations Security Council instead used a special session called by the United States to lecture the American ambassador on the proper purpose of the body and to reaffirm support for the Iran nuclear agreement.

It was an afternoon of high diplomatic theater that began with a passionate denunciation of Iran’s “oppressive government” by the American ambassador, Nikki R. Haley, and ended with the Iranian ambassador delivering a lengthy history of popular revolt in the United States — from the violent demonstrations at the Democratic National Convention in 1968 to the Occupy Wall Street protests in 2011.

In the interim, Council members did, one by one, condemn the Iranian government’s response during more than a week of protests. As of Friday, more than 20 people had been killed and hundreds had been arrested. The authorities have blocked access to social media and have blamed foreign “enemies” for instigating the unrest, a common refrain at times of upheaval that in this case the government has provided no evidence to support.

In her remarks, Ms. Haley said that the United States would remain steadfastly behind the Iranian protesters.