Turkey's parliament approved legislation on Monday granting a conditional pardon to thousands of Kurdish militants, a step intended to advance a peace process with the Kurdistan Workers' Party after four decades of insurgency.

Lawmakers passed the measure 468 to 88, according to The Associated Press. The law will take effect only once Turkish authorities confirm that the PKK has fully disarmed.

The 12-article legislation suspends some prison sentences for convicted members and postpones ongoing investigations and trials for five or 10 years, depending on the severity of the alleged offense. If no terror-related crime is committed within that period, the cases are dropped. Turkish media reports indicate thousands are likely to benefit, including members in exile in Europe and those based in Iraq and Syria.

Significant exclusions remain. Militants convicted of intentional killings and those sentenced to life terms before 2005 fall outside the law's provisions, NPR reported. That includes Abdullah Ocalan, the group's imprisoned founder, and other senior figures. Media reports suggest Ocalan's conditions on the island prison off Istanbul are likely to improve, with broader visiting rights and greater contact with the outside world.

In Diyarbakir, the largest city in Turkey's mainly Kurdish southeast, residents responded with a mix of relief, joy and uncertainty, The Washington Post reported.

The PKK began its insurgency in 1984, seeking an independent Kurdish state before shifting to demands for autonomy and expanded rights within Turkey. Kurds are estimated to make up 15 to 20 percent of the country's population. The conflict has claimed tens of thousands of lives and spilled into Iraq and Syria. Turkey, the United States and the European Union designate the PKK a terrorist organization.

The group announced last year that it was ending its armed campaign and dissolving itself, responding to a call from Ocalan. It then held a symbolic disarmament ceremony in northern Iraq and withdrew fighters from positions inside Turkey.

Parliament Speaker Numan Kurtulmus told reporters after the vote that the country would build a new era of peace and solidarity now that the organization has laid down its arms.

The legislation also carries domestic political weight. It gives President Recep Tayyip Erdogan an opening to court the pro-Kurdish DEM party, whose support could help him remain in office beyond the presidential two-term limit. Erdogan could run again if parliament calls an early election during his current term.