Last Thursday afternoon, a worried President Hafizullah Amin of the Democratic Republic of Afghanistan left the presidential mansion in Kabul for a former royal palace on a relatively defensible hillside, surrounded by gardens, south of town. Amin took with him the presidential guard and an armored unit of the dwindling Afghan army.

Earlier in the afternoon, Amin had received the visiting Soviet minister of communications, Nikolai Talyzin, along with the Soviet ambassador, for "a courtesy call" as part of "an official and friendly visit." Nevertheless, the Afghan leader may have had forebodings that at the moment the Russians might not be entirely courteous or friendly so far as he was concerned.

About 7 p.m., as reconstructed by American officials from sources in Kabul, Soviet airborne troops in armored personnel carriers surrounded Amin's refuge and opened fire. At the same time, other Soviet forces launched coordinated assaults on the presidential office, the main radio station, the telephone exchange and other targets.

Before the night was over, Amin had been overthrown and executed in a coup in which Soviet military forces supplied the muscle, a Soviet radio station posing as Radio Kabul made the first announcement and Soviet aircraft brought in the successor regime, which had been standing by in exile in Eastern Europe.

The coup in Kabul was pulled off with the aid of about 5,000 airborne troops, many from the Soviet Union's crack units between Moscow and Western Europe, who had been flown into Afghanistan in a mighty airlift averaging one flight every 10 minutes of daylight, from dawn on Dec. 24 to nightfall Dec. 26.

Immediately after the coup, on the legal justification of an "earnest demand" for military help from the new regime, much larger Soviet forces in readiness along the border rolled overland into Afghanistan. These motorized infantry divisions, which continue to be reinforced daily, are now estimated at 30,000 men in addition to the 5,000 airborne troops and nearly 5,000 military advisers and technicians.

The events of the last six days have propelled the thinly populated mountain fastness that is Afghanistan from obscurity to the forefront of international attention.

For the first time since the World War II, military forces of the Soviet Union have invaded a nation not already under occupation, raising an international outcry about the methods as well as the consequences of this extension of Moscow's power.

The repercussions on U.S.-Soviet relations as well as on the Kremlin's relations with Pakistan, Iran and other Islamic nations in the area have been great. The long-term strategic importance of a Russian-controlled wedge of territory jutting into South Asia toward the Indian Ocean is just beginning to be understood.

For all its wider significance, it is the consensus of American experts that Moscow was propelled into Afghanistan more by adversity than by design, more to protect than to advance, more through step-by-step reaction to unexpected local events than through worldwide considerations.

Many of the experts believe Moscow has undertaken a hazardous and costly enterprise which the Kremlin ultimately may regret. Some have called it Russia's Vietnam.

Afghanistan is a landlocked country about the size of Texas, with 15 million people and no known natural resources of importance. Its history has been described as "a 3,000-year search-and-destroy operation, with the emphasis on destroy." It was invaded by Cyrus the Great in 529 B.C., Alexander the Great in 330 B.C., the Arabs in 652 A.D., Genghis Khan in 1226, Tamerlane in 1329, the Mogul empire in 1526 and the British in 1838 and 1842. The Afghans, not surprisingly, are fierce and dogged fighters who do not take kindly to foreign domination.

As the most powerful immediate neighbor, the Russians have had a strong interest an major influence in Afghanistan for centuries. While the country remained an independent buffer state, the Russians have been by far the most important outside power for several decades, providing more foreign aid and military advisers than anyone else.

The extent and nature of Moscow's involvement changed abruptly in April 1978 when home-grown Marxists -- evidently without the encouragement or advance knowledge of the Russians -- ousted the previous aristocatic regime. The new group proclaimed a revolution, issued statements and some policies in communist style and turned to Moscow for support.

Louis Dupree, who is among the leading American academic experts on Afghanistan, has described the revolutionary regime as communist and Marxist -- but, in practice, "more Groucho than Karl." The three leading figures, whose rivalry predated the 1978 takeover and dictated much that happened since, were:

Nur Mohammad Taraki, president of the new regime and founder of the Khalq (masses) branch of the Afghan communist movement. Earlier Taraki had been cultural officer of Royal Afghanistan embassy in Washington and translator for the U.S. embassy in Kabul.

Hafizullah Amin, Taraki's senior aide in the political movement and organizer of the military support for the 1978 coup. Amin had been a student earlier at Columbia University teachers college.

Babrak Karmal, founder of the rival Parcham (banner) branch of the Afghan communist movement. The two branches united in mid-1977 to stage the coup, and Karmal briefly served as deputy prime minister in the new regime.

After three months of sharing power, Taraki and Amin ousted Karmal and other major figures of his Parcham branch of the party, sending them off as ambassadors to Prague (where Karmal went), Washington, London and other capitals. Two months after that, Parchamites at home were arrested and the ambassadors dismissed. They stayed abroad, reportedly gathering in Eastern Europe with Moscow's permission.

Taraki steadily became more of a figurehead leader, and the more-energetic Amin took increasing practical control of government affairs. The rigid policies of the small group of Marxist leaders, supported by growing Soviet assistance, touched off uprisings early last year. Before long mostly uncoordinated revolts spread to all parts of the country. An Islamic revolutionary figure proclaimed a "holy war" of Moslem tribesmen.

In April 1979, the Russians dispatched Gen. Aleksei Yepishev, a high-ranking official of the Soviet armed forces, and six other generals to study the growing insurgency. By then Russian advisers and their family members were being killed. Following this visit, the Soviets provided more trucks, artillery, tanks and other weapons and increased the number of military advisers. A diplomat in Kabul told Washington Post correspondent Jonathan C. Randal on a mid-May visit that "the Soviets' option to pull out entirely is no longer available. They are stuck."

By mid-summer the Soviet investment was still growing but the Afghan army was gradually crumbling from desertions and pressure from rebels in all of the country's 28 provinces. Most major roads were considered unsafe. An army unit in Kabul rebelled and was put down with Soviet gunships.

In mid-August the Soviets sent a higher level mission of some 50 officers headed by Gen. Ivan G. Pavlovsky, overall commander of Soviet ground forces who spent two months studying the swiftly disintegrating situation. It became clear to Pavlovsky and his superiors in Moscow, American officials now believe, that the Afghan revolution could not be maintained for long without another large increase in Soviet military assistance and involvement.

Political as well as military measures were needed to reverse the trend. Moscow found the independent, minded Amin resistant to advice, particularly the repeated suggestion that the leadership be broadened. When President Taraki came through Moscow in September on his way home from the conference of nonaligned nations in Havana, President Leonid Brezhnev gave him a bear hug and public backing -- and privately, it is widely believed, the Kremlin advised him to get rid of Amin.

What followed on Sept. 16 was a still mysterious shootout at the presidential mansion. Amin claimed in party documents that he was the target of an assassination plot by Taraki. Taraki's chief body guard was killed. Taraki "resigned" because of ill health, possibly a fatal bullet wound. He was buried shortly thereafter, and Amin took full control. Amin's private explanations to party members left the implication that Moscow had wanted to get rid of him.

The Soviets then faced a decision, particularly following the return of the Pavlovsky mission in mid-October. A Soviet-orchestrated offensive in the eastern province of Paktia, along the Pakistan border, was a disappointment -- the insurgents were hurt by Russian gunships and Afghan ground operations but, as in Vietnam, reasserted control as soon as the regulars left. And Amin was no more pliable than ever.

Much weighed in the balance with the Russians: their abhorrence of "counter-revolution" once socialism had triumphed, their touchiness about their border areas and about their own large Islamic tribal population, their international standing and relations with United States, among other factors. i

It seems likely their calculations were affected by the deepening U.S.-Iran conflict following the occupation of the American Embassy in Tehran Nov. 4. This gave rise to anti-Americanism in much of the Islamic world, as well as the threat of possible U.S. military action in Iran. The Russians have condemned such a prospect but, unlike the fall of 1978, they have issued no explicit warning against it.

In the first week of December, Soviet Ambassador Anatoliy F. Dobrynin was summoned home from Washington for what was described as a wide-ranging policy review. Before leaving, he investigated the uncertain prospects for ratification of the SALT II treaty, the Iran crisis, the American political climate.

On the weekend of Dec. 8-9, U.S. monitoring services began to see the Soviet decision, though this was unclear at the time. A special unit of Soviet troops with unusually heavy armament of tanks and artillery, was airlifted to Bagram airfield north of Kabul, which had been secured since July by a guard force of Soviet regulars. Ten days later the new combat unit would be deployed to clear the guerrilla-infested pass at Salang on the highway between Kabul and the Russian border, the eventual invasion route for overland forces.

Also in early December, the United States picked up the first signs of mobilization and movement by infantry divisions in areas of the Soviet Union near the Afghan border. U.S. officials began to consider it more likely -- but still not probable -- that the Russians would invade.

Washington began to issue statements of concern about the growing presence of Soviet combat formations in Afghanistan, including an unusual briefing for reporters by a high State Department official on Saturday, Dec. 22.

The answer came at dawn Dec. 24 with the beginning of the high intensity airlift which brought some 5,000 Soviet airborne troops to Kabul International Airport, with no attempt at disguising what was happening. It is presumed -- but not established -- that Amin approved the airlift of Soviet regulars in belief they would back his fight against the rebels. A still mysterious incident, possibly bearing on this, was another shootout at the presidential palace Dec. 19 when Amin's nephew, also his secret police chief, was wounded (and later died).

On Dec. 27, the day of the coup, the sky began to be clear of Soviet transport planes for the first time in three days. The Russian troops were in place in Kabul, and other Soviet units had been dispatched by air to the regional cities of Qandahar in the southeast and Shindand and Herat in the west to create a clear field of operation for additional airborne forces.

It is not known when Amin's old rival, Babrak Karmal, and the other Parcham faction leaders returned to Afghanistan from their Eastern European exile. It is widely believed they alighted from a Soviet transport plane some time after the coup. The former ambassadors including Nur Mohammad Nur, briefly ambassador to Washington and charged by the Taraki-Amin regime with taking over $2,000,000 in official funds, have been named to key posts in the new regime.

The first announcement of the coup, Karmal's recorded address declaring that "the bloody apparatus of Hafizullah Amin" had been overthrown, was broadcast by a station calling itself Radio Kabul, but was actually located at Termez just across the Soviet border. U.S. monitoring services first noticed the phantom station, with its ability to dominate the Radio Kabul frequency, just before the Taraki-Amin shootout in mid-September.

Last Thursday's Afghan coup was the third in the 20 months since April 1978, with the third executed president. It was the first in which the Soviet Union determined the political result, taking a giant step into an Afghan big muddy.