Soviet soldiers smiled and waved as their convoy left Kabul for home Wednesday on the strategic Salang Highway, an Afghan government spokesman said. Heavy shelling could be heard just up the road.

At dawn, the convoy moved through a checkpoint about two miles from the capital, en route to the Soviet border 250 miles away, said an interior ministry spokesman who identified himself only as Hamad.The spokesman said the convoy, mostly made up of trucks carrying up to 50 soldiers each, took 50 minutes to pass through the checkpoint.

"They were happy to be leaving. They were smiling and waving," he said.

Hamad said artillery fire heard about six miles up the road came from guerrillas hiding in the mountains that surround the highway, the only land route home for Red Army troops in Kabul.

Afghan soldiers refused to allow any non-military vehicles up the road, citing the possibility of heavy shelling. But crowded buses traveled south down the highway, with people riding on top dressed in ragged shawls and turbans that flapped in the winter wind.

Hamad declined to say when the next convoy would move out, but said convoys have been leaving every other day in recent weeks.

On Tuesday, Lt. Gen. Boris Gromov, commander of the Red Army forces in Afghanistan, would not say how many Soviet troops remained in the country or when the withdrawal would be completed.

Some military advisers will remain in Afghanistan in keeping with a Soviet-Afghan agreement, Gromov said. The United States contends such a presence would violate the Geneva agreements of April 14, under which the withdrawal is being conducted.