Tens of thousands of people from all over Spain rallied in the capital Saturday against punishing austerity measures enacted by the government, which is trying to save the country from financial collapse.

Large anti-austerity protests also took place in neighboring Portugal. Demonstrators in Lisbon threw tomatoes and fireworks at the Portuguese headquarters of the International Monetary Fund. Two protesters were arrested, but otherwise the rally was peaceful.

Spain is stuck in a double-dip recession with unemployment close to 25 percent. The conservative government of Prime Minister Mariano Rajoy has introduced stinging cuts and raised taxes in a bid to reduce the deficit and to reassure investors and officials from the 17-nation eurozone.

The marchers in Madrid unfurled banners with slogans such as "Let's go! They are ruining the country and we have to stop them."

"This government's policies are causing too much pain," union chief Ignacio Fernandez Toxo said. "It's a lie that there isn't another way to restore the economy."

The situation looks set to get worse in coming weeks. At a meeting of eurozone finance ministers in Cyprus on Friday, Spain revealed it would present a new set of economic reforms by the end of the month. It's a move that raises expectations that Spain might soon ask for financial help.

The economic reform plan will be unveiled by Sept. 27. It is expected to be the launch-pad to Spain's tapping of a new European Central Bank bond-buying plan.

Just before Saturday's march began, buses transporting protesters blocked several major roads in the Spanish capital. The main organizers were Social Summit, an association of more than 150 organizations, and the Workers' Commissions and General Workers trade unions.

The Interior Ministry's regional office said it had expected more than 500,000 people to reach a central Madrid square, but later said 65,000 had attended to listen to speeches made by protest leaders.

Toxo called for a referendum on the government's austerity and bailout plans, saying the measures were so different from the ruling Popular Party's election pledges that Spaniards should have the right to express an opinion on them.

Rajoy was swept to power with a large majority in November elections, having said "I have no plans to raise taxes."

The Madrid protest comes four days after another anti-government gathering in the northeastern city of Barcelona that attracted about 1.5 million demonstrators, according to police estimates.

"We've had our pay cut. We don't get the firefighting training and equipment we need. There are more students and fewer teachers in our children's classrooms, and health care is also being cut," firefighter Carlos Melgaves said, while marching in a group of about 50 firefighters. "We can't take it anymore."

Spain's economy minister, Luis de Guindos, said his government is aware it is asking citizens to make sacrifices.

They "are absolutely unavoidable if we are to correct the difficult economic climate we are experiencing," he said in Cyprus, where Europe's finance ministers were meeting Saturday. "We are laying the foundations for a recovery."

Rajoy has accepted a loan of up to €100 billion ($127billion) to help ailing banks reeling from a collapse of the country's real estate and construction industries. His government also has faced punishingly high interest rates while raising money on bond markets to keep the economy in liquidity.

The country is widely expected to ask to sell its bonds to the European Central Bank, but the conditions attached have been the subject of ongoing negotiations.

In Portugal, another package of recently announced government austerity measures could turn the nation's sullen acceptance of belt-tightening into an explosion of anger similar to that seen in Greece over the past two years.

More than 50,000 people said on Facebook they would attend a large protest in Lisbon and organizers called smaller demonstrations in 40 other Portuguese cities.

Last week, Portuguese Prime Minister Pedro Passos Coelho announced an increase in workers' social security contributions to 18 percent of their monthly salary from 11 percent. The cut is equivalent to a net monthly wage.

Portuguese Finance Minister Vitor Gaspar said income taxes will go up next year and public employees will lose either their Christmas or vacation bonus, roughly equivalent to a month's income. Many pensioners will lose both.

Protester Magda Alves said the austerity measures being applied to overcome the eurozone financial crisis were not working.

"What is being done in Portugal now was done in Greece, it is being done in Spain, and was also applied in other countries on other continents," Alves said. "The result was always the same: disaster."


Associated Press writers Barry Hatton and Yesica Fisch in Lisbon, Portugal, and Alan Clendenning in Madrid, contributed to this report.