ANKARA, Turkey (AP) — Turkey's parliament has approved a set of changes to the country's electoral laws that critics say are aimed at helping President Recep Tayyip Erdogan consolidate power and could lead to election fraud.

The changes were approved Tuesday after a tense, all-night session that saw altercations between nationalist and main opposition lawmakers.

Turkey faces elections next year, when Erdogan will need to secure 51 percent of the vote to remain at the helm.

The changes would allow Erdogan's ruling party to enter a formal alliance with the nationalist party, permitting the smaller party to gain parliamentary seats even if it fails to pass the 10-percent electoral threshold. In turn, Erdogan would secure the nationalists' continued support.

The opposition has called the plans a "dirty alliance" that would give the smaller party an unfair advantage over other parties. Critics also fear other amendments approved Tuesday will pave the way to voting fraud.

They include moves that would give the government the right to appoint government officials to oversee ballot stations, call in the security forces and to move ballot boxes.

The changes would also allow the electoral authority to count as valid ballot papers lacking an official stamp — a practice that had led to accusations of fraud during a referendum last year, which the opposition unsuccessfully challenged at a higher court.

The measures would come into force after Erdogan approves the changes. The main opposition party, the Republican People's Party, CHP, vowed to challenge the amendments at Turkey's Constitutional Court.

A brawl erupted in the assembly hall during the debate and continued in the parliament's lobby. A cameraman, mistaken for an opposition party aide, was attacked by nationalist deputies while filming the fighting with his cell phone but was not seriously hurt.

The elections are currently set for November 2019, but may be brought forward.