Polish lawmakers have voted to cut their own pay by 20 percent, an effort by the ruling party to boost its standing ahead of elections.

The plan was first announced last month by Jaroslaw Kaczynski, the head of the ruling Law and Justice party, following a scandal over bonuses that government ministers were awarded last year.

Lawmakers on Friday voted 240-2 in support of the measure, with five abstentions and 213 lawmakers from opposition parties boycotting the vote.

Last year's controversial bonuses were paid to several ministers by former Prime Minister Beata Szydlo, who fueled additional criticism by insisting the ministers deserved the money. Some of the bonuses were around $20,000, more than the average yearly wage in Poland.

Poland faces local elections this fall and parliamentary elections next year.