CARACAS, Venezuela — Tens of thousands of chanting protesters marched Thursday in a major demonstration in the Venezuelan capital aimed at forcing a vote on recalling socialist President Nicolás Maduro.

Opposition parties hailed the protest, dubbed the “Taking of Caracas,” as the beginning of a new stage in their struggle to end the “revolution” started in 1999 by Maduro’s predecessor, Hugo Chavez. Maduro’s popularity has plunged as the economy of the oil-rich country has sharply contracted and hunger has grown widespread.

The government arrested several prominent opposition activists in the days leading up to the protest and barred at least six foreign journalists from entering the country, according to the Committee to Protect Journalists. Fearing violence, downtown shops closed, and police in yellow vests took up positions around the city.

But the demonstration had an upbeat note, with participants dancing and joking, even as their chants reflected growing frustration with the government. “There’s no eggs, there’s no chicken, there’s nothing here,” one group yelled.

Others shouted: “It’s going to fall, it’s going to fall, the government is going to fall.”

Maduro claimed that turnout was about 30,000, but the crowd appeared far larger. Opposition groups estimated it at over 1 million.

The opposition has launched a recall drive to force new elections this year, three years before the end of Maduro’s term. Electoral officials, who are widely perceived to be government loyalists, have announced a timetable that would probably push the referendum into next year. The timing is important: If Maduro lost a recall vote next year, his vice president would succeed him, but if the referendum ousts him this year, an early presidential election would be held.

Opposition leaders announced they will hold new rallies on Sept. 7 and 14 to press the electoral authorities to move faster on setting up the referendum.

“Today is the beginning of the final stage of our fight,” said Jesus Torrealba, secretary-general of the Democratic Unity alliance.