A new draft constitution that significantly increases the powers of Turkish President Recep Tayyip Erdogan has been approved by voters in a referendum. Here, the BBC's Turkey correspondent, Mark Lowen, explains why this was such a bitterly-contested process.
In one brawl, a government MP alleged an opponent bit into his leg. In another, a plant pot was hurled across parliament. A microphone was stolen and used as a weapon. An independent MP handcuffed herself to a lectern, sparking another scuffle. The parliamentary debate on changing Turkey's constitution wasn't a mild affair.
On the surface, it might seem a proposal that would enjoy cross-party consensus: modernising Turkey's constitution that was drawn up at the behest of the once-omnipotent military after the coup of 1980.
But instead it's arguably the most controversial political change in a generation, giving sweeping powers to the country's powerful but divisive President Erdogan.
The plan turns Turkey from a parliamentary to a presidential republic. Among the numerous changes:
- The role of prime minister will be scrapped. The new post of vice president, possibly two or three, will be created.
- The president becomes the head of the executive, as well as the head of state, and retains ties to a political party.
- He or she will be given sweeping new powers to appoint ministers, prepare the budget, choose the majority of senior judges and enact certain laws by decree.
- The president alone will be able to announce a state of emergency and dismiss parliament.
- Parliament will lose its right to scrutinise ministers or propose an enquiry. However, it will be able to begin impeachment proceedings or investigate the president with a majority vote by MPs. Putting the president on trial would require a two-thirds majority.
- The number of MPs will increase from 550 to 600.
- Presidential and parliamentary elections will be held on the same day every five years. The president will be limited to two terms.
The government - and, principally, President Erdogan - argue that the reforms streamline decision-making and avoid the unwieldy parliamentary coalitions that have hamstrung Turkey in the past.
Since the president is no longer chosen by parliament but now elected directly by the people, goes the argument, he or she should not have to contend with another elected leader (the prime minister) to enact laws.
The current system, they say, is holding back Turkey's progress. They even argue that the change could somehow end the extremist attacks that have killed more than 500 people in the past 18 months.
A presidential system is all very well in a country with proper checks and balances like the United States, retort critics, where an independent judiciary has shown itself willing to stand up to Donald Trump and a rigorous free press calls him out on contentious policies.
But in Turkey, where judicial independence has plummeted and which now ranks 151 of 180 countries in the press freedom index of the watchdog Reporters Without Borders, an all-powerful president would spell the death knell of democracy, they say.
Mr Erdogan's opponents already decry his slide to authoritarianism, presiding over the world's biggest jailer of journalists and a country where some 140,000 people have been arrested, dismissed or suspended since the failed coup last year.
Granting him virtually unfettered powers, said the main opposition CHP, would "entrench dictatorship".
Ahmet Kasim Han, a political scientist from Kadir Has University, said before the vote: "It doesn't look as bad as the opposition paints it and it's definitely not as benevolent as the government depicts it.
"The real weakness is that in its hurry to pass the reform, the government hasn't really explained the 2,000 laws that would change. So it doesn't look bright, especially with this government's track record."
How did the referendum come to happen? The governing AK Party had to rely on parliamentary votes from the far-right MHP to lead the country to a referendum.
Opposition to the reform was led by the centre-left CHP and the pro-Kurdish HDP parties, the latter of which had been portrayed by the government as linked to terrorism. Several of its MPs and the party leaders are now in prison.
AKP and MHP voters who opposed the reform might have felt pressured into voting in favour, so as not to be tarnished as supporting "terrorists", especially since the referendum took place under the state of emergency imposed after the attempted coup.
"Holding the vote under this state of emergency makes it susceptible to allegations that people don't feel free to say no," says Dr Kasim Han. "It casts a shadow over the outcome."
With the detail of the constitutional reform impenetrable to many, the referendum became focused around Mr Erdogan himself: a president who elicits utmost reverence from one side of the country and intense hatred from the other.
The result will now determine the political fate of this deeply troubled but hugely important country.