The Turkish parliament on Friday passed a stripped down version of its controversial homeland security bill that has enraged the opposition after a fractious 16-hour debate.
The bill was approved in the early morning after an all-night session by the parliament, where the ruling Justice and Development Party (AKP) holds the majority.
Out of 231 deputies present at the session, 199 voted for and 32 against, the Dogan news agency reported.
The opposition had said the bill would allow President Recep Tayyip Erdogan to turn Turkey into a police state by giving the authorities new powers to crack down on protests.
The government had, in an attempt to compromise, put only a limited version of the bill up for vote.
Sixty-nine articles have been approved but the remaining 63 have been sent back to a parliamentary committee for further discussion.
However the articles voted on Friday include some of most contentious measures, including jail terms for protesters who carry Molotov cocktails and other such weapons.
The government put the bill before parliament following deadly pro-Kurdish protests in October and the wave of unrest against Erdogan in May-June 2013.