Several hundred protesters gathered Saturday for a rally organized by an opposition party, Musavat, which intended to ride the wave of revolts in the Middle East and North Africa. On Friday, about 60 people showed up to protest, following instructions on a Facebook page to wear red and find one another on the streets.

On both days, the police were waiting for the demonstrators, arresting them as soon as they began to gather.

They had a harder time controlling the fluid crowd on Saturday, filling a series of vans with detainees and calling in reinforcements.

“It is impossible to live under an authoritarian regime,” said one protester, Elkhan Alnagiyev, who was promptly arrested by undercover police officers who had seen him speaking to a journalist.

Another protester, Rashad Aliyev, said he had come because he was unemployed.

“It’s not that there are no jobs; it’s that I don’t know anyone who will put me in a job,” Mr. Aliyev said.

“They are oppressing us.”

Azerbaijan, a major producer of oil and natural gas with a population of nine million, was ranked as one of the most corrupt countries in the world last year by Transparency International.

The authorities have begun a campaign to crack down on graft, with high-profile firings of university administrators and other officials.

Mr. Aliyev has also been criticized for restricting the press and for failing to create meaningful democratic institutions.

Over the past week, the authorities warned university students that they could be expelled if they missed classes during the protests. Mubariz Qurbanli, a member of the governing New Azerbaijan Party, said the low turnout on Friday proved that the people of Azerbaijan did not support the opposition.

“Everyone understands that confrontation and chaos harm each member of society,” Mr. Qurbanli said in comments that were carried by the Interfax news service on Friday. “All such attempts will meet the same fate because there is no support for more radical politics in Azerbaijan.”

The Interior Ministry reported that 43 people had been detained on Friday and 50 on Saturday, and said that about 40 of those were likely to be prosecuted, according to Interfax.

Among those detained before the protest were Bakhtiyar Hajiyev, the only organizer of the Friday protests who is living inside the country; he was taken into custody on March 4.

The United States Embassy said in a statement that it was following reports of Mr. Hajiyev’s detention “and, in particular, allegations that he may have suffered abuse and been denied legal counsel.”

The police also detained Etibar Salmanli, who was shown on a YouTube video distributing pink leaflets about the protests. On Thursday, the Justice Ministry closed the Azerbaijan Human Rights House, which that assists activists and defenders of human rights.

The protest on Friday was among the first to be organized online in Azerbaijan, where the number of Facebook users has jumped in recent months.

According to Socialbakers.com, a Facebook traffic-tracking Web site, Azerbaijan’s Facebook use grew by about 5 percent in February to reach 324,880 people, more than three-quarters of whom are 18 to 34 years old.

“Facebook is a huge asset for us,” said Turgut Gambar, who was arrested and released Friday after the police spotted him with a group of young people dressed in red.

“I hear people talking about the 11th of March without us making a huge, huge effort.”