KABUL, Afghanistan (AP) _ The last Russian diplomats pulled out of the war-battered Afghan capital Saturday, closing the books on a decade of bloody involvement by a once- powerful neighbor.

About 50 Russian diplomatic staff members and their families left aboard an Antonov transport plane. They arrived in Moscow late Saturday, the ITAR-Tass news agency reported.

The departure was kept secret following a rocket attack on Kabul airport on Friday that destroyed one of three Ilyushin-76 military transport planes sent to evacuate the 170 embassy employees and their families.

Many on Saturday's flight said they had wanted to stay, but Moscow ordered them to leave, saying Kabul had become too dangerous. The Russian mission had become a target of rebels determined to avenge the 1979 invasion and nine-year occupation of Afghanistan by the former Soviet Union.

The Russians' forbidding fortress-like compound is riddled with bullets and shrapnel. The main building has been sealed and the compound emptied but for a few pro-government security guards.

The last vestiges of Moscow's once-vast influence in Afghanistan were erased from Kabul long before the Soviet Union disintegrated, and long before the Soviet-installed Afghan government collapsed in late April.

Russian words were scratched off shop windows, pro-Marxist literature locked in storage and the colorful larger-than-life posters praising the virtues of the Communist revolution were pulled down.

Widespread street crime, relentless firefights betwen factions of the Islamic leadership and the relentless bombardment of rockets and mortars on the capital have made many Afghans forget the oppression and terror of living in a police state.

''Things weren't a tenth as bad when the Communists were around,'' said Humayun Farid, 41, who sells vegetables and fruit in what was known until a few months ago as Brezhnev bazaar.

Named for the former Soviet leader Leonid Brezhnev, the bazaar once did a thriving business during the occupation selling stolen parts from Soviet tanks, jeeps and trucks.

Brezhnev ordered the Red Army into Afghanistan in 1979 to prop up the Marxist government tottering under a growing rebellion throughout the Muslim countryside.

By the time Moscow had agreed to withdraw all 115,000 troops in February 1989, two-thirds of Afghanistan 15 million people were either dead, wounded or living as refugees in Iran and Pakistan.

At least 13,000 Soviet troops also have been killed and more than 15,000 wounded in a conflict that was often called Moscow's Vietnam.

The Islamic government has publicly said it wanted good relations with its northern neighbor. But Russian diplomats said old animosities kept cropping up and that the bloody past haunted relations.

Diplomats said their differences were over war reparations and over efforts to find out what has happened to some 300 Soviet soldiers missing in Afghanistan as well as other residual problems.

When Kabul's security deteriorated and the city came under rocket attack earlier this month, the Russians were targeted.

The embassy was shelled and often peppered by machine gun fire. Some of its staff members were killed or wounded, most of them technicians trying to help maintain Kabul's generator, water supply system and other public services.

Some staff may remain in Mazar-e-Sharif to help the Russian consulate, whose main duty is issuing visas. Once Kabul is safe, Kabulov said that they may return.

The Islamic government may regret the Russians departure, say some. Afghanistan is desperate for international assistance to rebuild a devastated country and a ruined economy, but diplomats say that Russia will likely be less sympathetic toward the enormous growing problems of its southern neighbor.

They said the only leverage the new government now has with Russia are the POWs - and the Russians have all but given up hope of ever getting them back.

''They'll probably adopt the same attitude toward Afghanistan that the United States did toward Vietnam and say 'We've suffered enough. We don't care about Afghanistan anymore,''' said one diplomat, speaking on condition of anonymity.