With the onset of a major spring offensive by Soviet and Afghan troops against rebel bands in the countryside, guerrillas have escalated their attacks in and around Kabul, according to western diplomatic reports from the capital.

Diplomatic sources here, whose accounts were supported by refugees who left Afghanistan recently, said today that Afghan rebels during the weekend besieged a military garrison opened only last month in south Kabul, killed or captured all of its Afghan Army occupants and seized a large cache of ammunition. They reportedly were aided by a mutinous Afghan soldier in the garrison.

Following the daring nighttime attacks in the Qala-e-Wahe neighborhood of south Kabul and sustained rebel firing on Afghan Army positions in the nearby Char Gala-e-Chardelhi district, the guerrillas were reported to control that entire area of the capital during darkness.

The fatal shooting of an unarmed Afghan civilian by a Soviet soldier in central Kabul on Sunday triggered the largest antigovernment demonstration since a series of protests in February, the diplomatic sources said.

They said an Afghan student was shot to death during an altercation with the Soviet soldier in a gas station, after which a large crowd shouting, "Death to the Soviets" stoned Soviet vehicles. Afghan Army troops arrived, disarmed the Soviet soldiers and took them away from the crowd, but the Kot-e-Sange neighborhood of the capital was reported to have remained tense.

The diplomatic sources said rebels also surrounded the home of an Afghan Communist Party official, kidnaped him and, after a prolonged exchange of gunfire with security forces, escaped. Also on Friday, two suspected Afghan informers were assassinated in the capital.

Citing "reliable" Afghan sources, the western diplomats said that the commander of the 8th Division of the Afghan Army, Maj. Gen. Mohammed Nabi Azimi, was critically wounded on March 16 when rebels fired a rocket at his jeep during an inspection tour near Paghman, 15 miles northwest of Kabul.

Reports from two western diplomatic missions in Kabul said that the main highway from the capital to the Salang Pass to the Soviet border has been closed to most traffic as a result of guerrilla activity and an avalanche.

The highway disruption, compounded by the destruction of a key bridge two miles north of the Salang tunnel, has resulted in severe shortages of fuel in Kabul, the diplomatic sources said.

Moreover, repeated sabotaging of a petroleum pipeline from the Soviet frontier to the Bagram Air Base near Kabul has increased the necessity to keep the highway open to supply Soviet forces, diplomatic analysts said.

But Soviet and Afghan forces were reported to have launched major offensives in several areas of rural Afghanistan.