Pro-Kurdish lawmakers say this is essentially a move to expel opposition members from parliament.
The measure is seen as targeting the pro-Kurdish Peoples' Democratic Party (HDP) as well as the main opposition Republican People's Party (CHP).
Turkey has led an offensive against the insurgent PKK, accused of being a terrorist group.
A ceasefire ended weeks after elections in June 2015. The renewed conflict has claimed hundreds of lives on both sides, particularly in the south-east.
President Recep Tayyip Erdogan has called for pro-Kurdish MPs to face terrorism charges and this vote could be a first step towards making that happen.
The bill was backed by 376 MPs in the 550-seat legislature, which means it will become law directly without being put to a referendum, parliamentary Speaker Ismail Kahraman said.
The pro-Kurdish HDP party says the government is using trumped-up charges to push their party out of parliament and allow President Erdogan to change the constitution and boost his own powers.
The government rejects that claim, saying MPs should be accountable before the law. In a country with faith in its democracy and judicial independence, that would be the accepted view.
But in Turkey there are deep misgivings about both and Mr Erdogan is seen by critics as increasingly authoritarian - hence the concerns.
If several HDP MPs are arrested, there are fears it could spark worse violence in Kurdish areas, where people could feel deprived of a voice in parliament. And so this is a dangerous moment for Turkey and a test of how far Mr Erdogan is willing to go to secure his position.
Violent scuffles marred parliamentary debates this month, with frustrated lawmakers exchanging fisticuffs and kicks.
Friday's vote was not without incident as CHP lawmakers walked out in protest.
Mr Erdogan said the vote was "historic" during a televised speech in his hometown of Rize.
"My people do not want to see guilty lawmakers in this parliament," he said as lawmakers voted.
German Chancellor Angela Merkel's spokesman said she would raise concerns over the state of democracy in Turkey when she met Mr Erdogan next week.
The Turkish parliament has approved a controversial bill that will strip MPs of their immunity from prosecution.