TEHRAN — All this week panicked Iranians have gathered in throngs outside banks and other financial businesses hoping to buy dollars, as the government seeks to head off a collapse in the rial, the national currency.

But they have met with nothing but frustration, told there were no dollars or other currencies for them to buy at the official government rate. In an effort to stop the run on foreign exchange, the government has forbidden anyone from holding more than the equivalent of $10,000 in dollars or euros, which account for most of the foreign exchange in Iran.

Long on a downward path, the rial plunged this week, losing 35 percent of its value against the dollar and hitting what has been widely described as a record low. The government is seeking to impose an exchange rate of 42,000 to the dollar, but in Tehran’s black-market exchanges this week the going rate was 60,000. When President Hassan Rouhani took office in 2013, the rate was 36,000.

In an effort to squelch currency speculation, the government sent riot police into the bazaars on Wednesday, where they arrested several money changers. One senior cleric, Ayatollah Nasser Makarem-Shirazi, said that some money changers ought to be executed to set an example.