MOSCOW, OCT. 9 -- The Soviet legislature ruled today that all political parties are equal before the law, giving the country a legal basis for a multi-party system.

After decades of one-party rule, the Communist Party yielded to public pressure in March and gave up its constitutional guarantee of power. Since then, scores of political parties have been created, ranging from socialists to free-market libertarians.

The legislature, or Supreme Soviet, also ruled that the Communist Party cells that have traditionally held great power inside every major Soviet institution, including the KGB secret police and the military, would no longer have any legal authority. The legislators said that eventually the Communist Party units in the security organs and military departments would have equal standing with groups from other parties and even religious organizations.

Former KGB major general Oleg Kalugin, who now holds a seat in the Congress of People's Deputies, said recently that despite the shift in power from the party to elected government bodies, the KGB still "routinely" bypasses government bodies and provides information to party organs.

The Communist Party is in sharp decline, losing more than 600,000 members this year. The country's most popular politician, Russian President Boris Yeltsin, as well as Mayors Gavril Popov of Moscow and Anatoli Sobchak of Leningrad, left the party after its July congress. This week's meeting of the party's Central Committee was, for most Soviets, an irrelevant event.

However, the Communist Party leaderships in the smaller cities and provinces are still extremely powerful and rule in fact if not in law. The party also owns huge amounts of property -- it is the world's largest landowner, according to legislator Yuri Chernichenko -- and controls countless newspapers, journals and television stations.

The legislature's new law on political organizations does not make clear whether the new political parties will be guaranteed equal access to mass media. Yeltsin and other radical leaders have demanded that the Communist Party become a Western-style parliamentary political party and either give up or sell most of its properties.