ISTANBUL — Turkey’s Parliament met through the night, Friday into Saturday, and passed a controversial new bill that gives the government greater control over the judiciary — but not before a brawl on the floor of the assembly left one lawmaker with a broken finger and another with a bloodied nose.

The raucous scene, as well as the fisticuffs that broke out during a previous debate on the bill, was emblematic of the messy turn Turkish politics has taken recently, as a corruption investigation targeting Prime Minister Recep Tayyip Erdogan and his inner circle has thrust the government into crisis.

Critics charged that the judicial bill is the latest attempt by Mr. Erdogan to survive the corruption investigation. Experts say the legislation, which still needs to be signed by the president and is sure to face challenges in the constitutional court, would eviscerate any measure of a separation of powers in the Turkish political system.

Mr. Erdogan has blamed the investigation on supporters of the Islamic cleric Fethullah Gulen, who lives in exile in Pennsylvania and whose followers have, over the years, built up deep influence in Turkey’s police and judiciary. The prime minister has referred to Mr. Gulen’s followers as a “parallel state” that has engineered the graft inquiry to overthrow the government and has reassigned thousands of police officers and hundreds of prosecutors to lesser posts.