The Soviet parliament ended decades of state persecution of organized religion Monday by giving final approval to a law guaranteeing freedom of worship.

The law, which was approved in principle by the Supreme Soviet Wednesday, gives citizens the right to determine their own attitude to religion, provides for separation of church and state and sets all religions on an equal footing.The legislation capped five years of change in relations between the Soviet state and religious groups whose followers had been routinely imprisoned or sent to labor camps since the time of Josef Stalin.

The chamber voted 341-2 to approve a resolution putting the law into effect.

Deputies gave their final approval after resolving a wrangle over religious instruction by deleting a provision that would have specifically allowed instruction in schools outside normal class hours.

The patriarch of the Russian Orthodox Church, Aleksiy II, had appealed to the chamber to leave the provision in, saying if it was left out it would represent "a step back" in the country's move to democracy.

Under the more liberal leadership of President Mikhail Gorbachev, scores of houses of worship used for decades as museums, halls or warehouses have been handed back to religious communities.