Jaroslaw Kaczynski,right, the head of Poland's ruling party, and parliament speaker Marek Kuchcinski after at a news conference where Kuchcinski announces his resignation in Warsaw, Poland, on Thursday Aug. 8, 2019. Kuchcinski's resignation was prompted by public anger over his and his family's frequent use of government aircraft. Kuchcinski and Kaczynski insisted that the speaker had broken no law and did nothing wrong but that they were acting in response to the public anger.(AP Photo/Czarek Sokolowski)

WARSAW, Poland (AP) — The speaker of the Polish parliament said Thursday that he is resigning after a scandal erupted over his and his family's frequent use of government planes.

The affair was threatening to damage the reputation of the right-wing ruling party, Law and Justice, ahead of parliamentary elections in October.

Speaker Marek Kuchcinski said his resignation would take effect on Friday. He made the announcement at the party's headquarters alongside party leader Jaroslaw Kaczynski.

Kuchcinski insisted that he had done nothing wrong and had simply flown a lot in order to meet the residents of small towns far from the capital. But he said that "because public opinion evaluates my conduct in a negative way, I decided that I could no longer fulfil this function."

Polish politics have for days been consumed by the affair that has been dubbed "Air Kuchcinski." The speaker was revealed to have flown often by government jet from Warsaw to his home city of Rzeszow, some 280 kilometers (175 miles) to the south. In one case, his wife was reportedly the sole passenger of a flight.

During Thursday's news conference, Kaczynski said the speaker had not broken the law, but that his party was keen to respond to public anger and show that it sticks to high ethical standards.

Kaczynski said the key problem was a lack of clear regulations for the use by officials of government flights, and noted that former prime minister, Donald Tusk, now a top European Union leader, also took numerous flights with his wife between Warsaw and his home city of Gdansk. He said that new rules will now be put in place.

Opinion polls show Law and Justice as the most popular political force in the country ahead of the elections scheduled for Oct. 13.

The district prosecutor's office in Warsaw announced Wednesday that it was investigating possible irregularities in connection with Kuchcinski's flights.

Marek Kuchcinski, left,the speaker of the Polish parliament, announces his resignation at a news conferencein Warsaw, Poland, Thursday, Aug. 8, 2019. His resignation was sparked by a scandal erupted over his and his family's frequent use of government planes. Kuchcinski insisted that he had done nothing wrong and had simply flown a lot in order to meet the residents of small towns far from the capital. But he said that
Jaroslaw Kaczynski, the head of Poland's ruling party, speaks at a news conference where the speaker of the parliament resigns in Warsaw, Poland, on Thursday Aug. 8, 2019. Kuchcinski's resignation was prompted by public anger over his and his family's frequent use of government planes. Kuchcinski and Kaczynski insisted that the speaker had broken no law and did nothing wrong.( AP Photo/Czarek Sokolowski)
Marek Kuchcinski, left,the speaker of the Polish parliament, announces his resignation at a news conference in Warsaw, Poland, Thursday, Aug. 8, 2019. His resignation was sparked by a scandal erupted over his and his family's frequent use of government planes. (AP Photo/Czarek Sokolowski)
Jaroslaw Kaczynski, the head of Poland's ruling party, speaks at a news conference where the speaker of the parliament resigns in Warsaw, Poland, on Thursday Aug. 8, 2019. Kuchcinski's resignation was prompted by public anger over his and his family's frequent use of government planes. Kuchcinski and Kaczynski insisted that the speaker had broken no law and did nothing wrong. (AP Photo/Czarek Sokolowski)
Jaroslaw Kaczynski, the head of Poland's ruling party, arrives at a news conference where the speaker of the parliament resigns in Warsaw, Poland, on Thursday Aug. 8, 2019. Kuchcinski's resignation was prompted by public anger over his and his family's frequent use of government planes. Kuchcinski and Kaczynski insisted that the speaker had broken no law and did nothing wrong. (AP Photo/Czarek Sokolowski)