BUENOS AIRES (Reuters) - Argentina’s Congress passed a reform to the pension system on Tuesday, after days of demonstrations by the bill’s opponents and violent clashes between protesters and police.

The measure is central to President Mauricio Macri’s plan to slash the fiscal deficit and attract investment. It paves the way for further market-friendly legislation that his Cambiemos, or “Let’s Change” coalition hopes to pass in extraordinary congressional sessions before the end of the year.

The law changes the formula used to calculate benefits by linking them to consumer prices instead of tax income and wage hikes. The government says that will make benefits more predictable and sustainable, and they will still increase by more than inflation next year.

“This formula guarantees that over the next few years, retirees will never lose against a jump in inflation,” said Macri, who took office in December 2015 after more than a decade of populist rule.

Macri tweaked his proposal, pledging a one-time bonus payment to the neediest retirees, after clashes last Thursday derailed congressional debate.

Still, the measure generated fierce criticism from opposition lawmakers and labor unions, who say it will hurt retirees. The debate prompted demonstrations on Monday. Thousands took to the streets of the capital Buenos Aires and around the country, banging pots and pans and blaring car horns.

Stone-throwing protesters confronted police, who responded with water canon, rubber bullets and tear gas. Dozens were injured.

Slideshow ( 4 images )

“All these changes generate discomfort, but they are necessary,” Macri said after the measure passed the lower chamber of deputies 127-117, with two abstentions, following an all-night debate session. The Senate approved the proposal last month.

The government will now press congressional votes on a tax code overhaul and a deal with provinces to limit spending, Macri told reporters.

Economists, noting that inflation expectations are lower, said linking benefits to consumer prices would lower spending by around 0.5 percent of gross domestic product (GDP) next year.

But savings from the pension reform will finance transfers from the national treasury to provinces as part of the fiscal pact, said economist Ariel Barraud of the Argentina Fiscal Analysis Institute in Cordoba, Argentina.

“Almost all of the savings obtained from the pension formula change will go to compensate the fiscal deal,” Barraud told Reuters by phone.

Argentina’s government is aiming to cut the deficit to 3.2 percent of GDP from 4.2 percent currently.

Slideshow ( 4 images )

NO MAJORITY

Cambiemos lacks a majority in Congress despite a strong performance in October’s legislative midterm. Dozens of votes from opposition lawmakers were needed to pass the pension measure.

Other leaders in South America have had a harder time implementing similar business-friendly agendas.

In Peru, measures meant to boost growth have stalled as President Pedro Pablo Kuczynski has fought efforts to remove him over his ties to scandal-plagued Brazilian builder Odebrecht. Brazil’s efforts at its own pension reform were recently pushed back until next year.

Despite passage of the pension measure, Macri’s agenda still faces substantial popular skepticism.

“They are encroaching upon the rights of society’s most vulnerable,” opposition lawmaker Facundo Moyano said during the congressional debate.