Moslem rebels in Afghanistan Friday took advantage of the vacuum left by the withdrawal of Soviet troops to seize a major town for the first time since the pullout began May 15, Soviet sources said.

The rebels occupied most of Kunduz, 40 miles from the Soviet border, leaving only the airport in the hands of government troops, the sources said."They took a very big initiative," a source said. "This is the first time they have taken a major town.

The seizure of Kunduz marks the first time the rebels have taken a major town in Afghanistan. Since the Soviet Union began pulling out May 15 the guerrillas have captured some 30 garrisons and outposts that were mostly abandoned, but have failed to mount a major military operation against Kabul or other large cities.

Western diplomats and private analysts say the Afghan military is demoralized and plagued with desertions, but are undecided whether the fractious seven-group rebel alliance fighting the Moscow-backed regime can unite long enough to deliver a toppling blow to the government.