Turkey's parliament has voted in favour of a reform package that includes lifting the death penalty in peacetime and other rights reforms aimed at preparing the country for European Union membership.
The package includes measures ending punishments for criticism of the armed forces and other pillars of the Turkish establishment, outlawing organ and people smuggling and easing restrictions on the Kurdish language.
The package, passed after a marathon debate lasting close to 22 hours, ends years of state restrictions in key areas. The vote to abolish the death penalty in peacetime was a watershed for a country that only three years ago was baying for the blood of PKK (Kurdistan Workers Party) guerrilla leader Abdullah Ocalan, blaming him for more than 30,000 deaths in conflict with security forces.
The package was rushed through parliament by pro-EU forces who wanted to complete the reforms before campaigning starts for a general election on November 3. The package now only needs the president's ratification, expected to be a formality.
Ankara wants the European Union to set a date by the end of the year for Turkey to start membership talks. The EU wants to see reforms implemented as well as being passed before it sets a date and even Turkish commentators admit that there is still work to be done to meet the EU's strict criteria.
"There are some very sensitive issues in this package," one Western diplomat said as parliament was debating the reforms.
"It's a significant step in the right direction." Markets are hoping progress towards the EU will help attract foreign investment to haul Turkey's economy out of recession and bolster a $16 billion IMF economic rescue programme. Stocks and the lira rose on Friday amid hopes the reforms would pass.
The most heated debate surrounded the first clause of the package, removing the death penalty from Turkey's civil code except in times of war or near war.
Nationalists argued that could save Ocalan, the PKK leader who was captured in 1999 after an international man-hunt.
Another major change allows television and radio broadcasts in Kurdish on the condition they follow constitutional principles and do not incite violence.
Ex-patriot Turkish Kurds in Europe have been broadcasting via satellite to Turkey for years, much to the anger of the Turkish state, which accused the channels of acting as a mouthpiece for separatist rebels of the PKK.
In one step that will be welcomed by the EU, the reforms also introduced tough penalties for people and organ smugglers.