BRASILIA (Reuters) - Brazil’s scandal-plagued political class voted on Wednesday to set up a 1.7 billion reais ($542 million) fund with taxpayer money to finance election campaigns, making up for a dearth of private funding ahead of next year’s general election.

A ban on corporate donations coupled with the drying up of under-the-table contributions and kickbacks in the wake of the country’s biggest corruption scandal have left lawmakers struggling to raise campaign funding.

The lower house of Congress approved a bill that had passed the Senate and will take funds from pork barrel appropriations and government payments to buy TV and radio time for parties.

The fund was meant to be part of improvements to Brazil’s discredited political system to reduce a proliferation of parties that has made it hard to govern Latin America’s largest nation without unwieldy coalitions based on self-interest.

The Senate unanimously approved on Tuesday a constitutional amendment that limits coalitions to parties with similar platforms, but it will not go into effect until the 2022 elections.

More than 100 lawmakers are targeted by the Car Wash corruption investigation that uncovered a network of bribes from private companies seeking to win contracts or influence policies, and even implicated President Michel Temer and several of his cabinet ministers.

Critics of the campaign fund said it was aimed at providing funding for lawmakers seeking re-election to shield themselves from prosecution for corruption.

“It is shameful that this fund will be used by unethical politicians who should not be sitting here in Congress,” said Julio Delgado, leader of the Brazilian Socialist Party (PSB). “Not a single lawmaker under investigation has opposed it.”

Backers of the use of public money for campaigns argued that organized crime would step in to finance politicians if funding was lacking.

The sprawling Car Wash graft investigation that convicted dozens of executives from Brazil’s main contractor companies has shut down the flow of undeclared payments to politicians.

“What most worries them is where they will get money for their campaigns now that companies cannot donate and are not willing to engage in illegal contributions,” said Lucas de Aragão, partner at political risk consultancy Arko Advice.

On the positive side, he said, Congress set a threshold for parties to be able to access public funding and free TV time based on the votes they win, which will help reduce the number of parties, today totaling 35.

(This version of the story corrects the fifth paragraph to say coalitions reform will not go into effect until the 2022 elections).