Iran has made a strong protest over what it calls American "interference" in its internal affairs.
The detainees were taken to Tehran's Evin prison
The diplomatic move came after almost a week of anti-government protests, which US President George W Bush said were "the beginnings of people expressing themselves toward a free Iran".
The Iranian foreign ministry had already attacked the US for "flagrant interference in Iran's internal affairs", but a formal note has now been sent via the Swiss embassy in Tehran.
Thirty "miscreants and hooligans" are being held by police, after thousands took to the streets in a sixth night of demonstrations on Sunday.
A police commander quoted by the official Irna news agency did not say whether those detained were anti-regime protesters, or hardline Islamic vigilantes opposing them.
On Sunday an influential group of Iranian dissidents issued an unprecedented declaration defending the right to criticise their leaders.
As well as criticising the conservative clerics, demonstrators have also attacked the reformist President, Mohammad Khatami, who is accused of betraying hopes for change.
The latest demonstrations were again concentrated around Tehran university's main campus.
Protesters converged on the area in cars, as they have been doing since the gathering of a few hundred students on Tuesday night grew into nightly protests by thousands of people.
Hardline Islamic vigilantes, some carrying
assault rifles and wearing bullet-proof vests, patrolled streets near the campus.
Gunshots were heard near the university late on Sunday but there are no reports of any casualties.
The vigilantes, loyal to Supreme Leader Ayatollah Ali Khamenei, have attacked demonstrators with clubs, knives and chains on previous nights.
Police have warned them against taking the law into their own hands.
The statement from the dissidents has greatly increased the political temperature.
Signed by 248 intellectuals, reformist journalists and several clerics, it said the people of Iran had "the right to fully supervise the action of their rulers".
"Sitting or making individuals sit in the position of divine and absolute power is a clear heresy towards God and a clear affront to human dignity," said the declaration.
But reformist members of the Iranian establishment have joined the conservatives in strongly condemning US support for the demonstrations.
Some Iranian opposition groups fear that direct US support could play in the hands of the hardliners in the regime, BBC regional analyst Sadeq Saba says.
Student associations have said they will continue to demonstrate until 9 July, to commemorate the violent attack by hardline groups on students four years ago.
Have you been involved in the protests? Have they affected you in any way? Tell us your experiences
Disclaimer: The BBC may edit your comments and cannot guarantee that all e-mails will be published.