Soviet troops remained bogged down in Afghanistan yesterday, five years after they invaded to install a pro-Moscow Communist government.

The anniversary was marked by protests in world capitals and was ignored in Moscow, where the Communist Party newspaper Pravda, reviewing the Afghan Communist Party's 20-year existence, said the party was fighting "a wide-scale imperialist plot headed by the United States."

President Reagan, in a comment to reporters as he headed for a week's vacation in California, rejected Wednesday's charge by Sen. Gordon J. Humphrey (R-N.H.) of "serious mismanagement" in U.S. aid to Afghan rebels. "We do the best we can in anything of this kind, under very difficult circumstances," Reagan said of the covert aid program, which Humphrey estimated at $300 million since the invasion.

Reagan, echoing Franklin D. Roosevelt's description of the Japanese attack on Pearl Harbor as "a day that will live in infamy," said, "I guess that's what this is also, the anniversary of a day of infamy."

"There is no legitimate excuse for a great power like the Soviet Union that is doing what it is doing to the people of Afghanistan," Reagan declared.

Several hundred protesters marched from Dupont Circle to a rally at 16th and K streets NW, about a block from the Soviet Embassy, chanting "Long live Afghanistan" and "Death to the KGB." A protester said embassy representatives refused to accept a declaration denouncing "Soviet atrocities."

One of the largest protests took place in the Indian capital of New Delhi, where about 2,000 Afghan refugees attempted to break through police lines around the Soviet Embassy. The demonstrators burned effigies of Soviet President Konstantin Chernenko.

Tehran Radio said thousands of Afghan refugees marched through the streets of the Iranian capital. Other demonstrations were reported in Dhaka, capital of Bangladesh, as well as in Bangkok, Bonn and Copenhagen.

In Kabul, the Afghan capital, Soviet troops were reported to have been placed on increased alert against rebel attacks. Radio Kabul, monitored in Pakistan, said five years had passed since the Afghan Communist Party, "with the aid of Afghanistan's great friend, the Soviet Union," saved the country from revolutionaries backed by U.S. and Chinese imperialists.

Soviet troops were airlifted into Afghanistan starting on Dec. 25-26, 1979, and brought down the country's independent Marxist president, Hafizullah Amin, on Dec. 27, installing as his successor Babrak Karmal, a longtime party rival who had been exiled to Czechoslovakia.

Radio Kabul, noting the continuing fighting, said Karmal sent greetings to soldiers "winning great victories in direct confrontation with the enemy in the Panjshir Valley," a rebel stronghold north of Kabul.

The official Afghan radio claimed that the rebels' "counterrevolution" had been crushed but it said the rebels had slowed the country's economic progress and were resorting to increasingly criminal methods, Reuter reported from Islamabad, Pakistan. The agency said the reference to "criminal methods" echoed earlier complaints about increasing rocket attacks on Kabul in retaliation for Soviet air raids on rebel-dominated rural areas.

Radio Kabul also renewed its offer of direct talks with Pakistan yesterday, but coupled the offer with new accusations of border violations. The two countries have held indirect talks through the United Nations. Pakistan has also accused Afghanistan of repeated border violations in air raids on Pakistani towns used by the rebels.

Western diplomats and Afghan exiles told Reuter that the Soviet forces, now estimated at 115,000, had signaled readiness to fight through the harsh winter with operations in the Panjshir Valley and in Paktia and Kunar provinces, bordering Pakistan.

The sources said the Soviets' goal was to cut off rebels wintering in Afghanistan from those who had moved to warmer bases in Pakistan, intending to return in the spring.

In Moscow, the Communist Party youth newspaper Komsomolskaya Pravda, while making no reference to the anniversary, published a full page of articles about military service in Afghanistan, characterized as fulfilling "internationalist duty." In one article, an Afghan soldier was quoted as saying that without Soviet help Afghanistan would not appear on world maps.

Leaders of the western allies meanwhile issued anniversary statements calling on the Soviets to withdraw in observance of repeated United Nations resolutions..

British Foreign Secretary Geoffrey Howe called the continued occupation "an impediment to good relations not just with the West but between the Soviet Union and the rest of the world."

"In Afghanistan," France's Foreign Ministry said, "five years after the Soviet invasion, the fait accompli remains a brutal but illegal fact. Injustice does not attenuate with time, it gets worse."