The Soviet Union announced this morning that it is withdrawing "some Army units" from Afghanistan because they are "no longer necessary."

According to a six-line statement from the Afghan capital of Kabul by the official Tass news agency, the partial withdrawal was agreed upon between "the command of Soviet military contingents now staying in Afghanistan" and the Afghan government.

The surprise announcement came even as Western military sources here were reporting a slow but steady increase in the number of Soviet troops in the country. Western analysts estimate that 85,000 Soviet troops are stationed in Afghanistan.

The meaning of the surprise announcement was not immediately clear here, but the terse statement did not disclose how many troops or which ones were being withdrawn.

The announcement came several hours after Soviet leader Leonid Brezhnev reportedly sent a message to French President Valery Giscard d'Estaing on the question of Soviet troop levels in the country.

Giscard was the first Western leader to meet with Brezhnev following the Soviet invasion in late December.

The announcement comes as the Western allies are meeting in Venice in part to try to coordinate policies in response to the Afghan invasion. It also comes before the July 19 opening of the Moscow Olympic Games, which have been badly crippled by a U. S.-led boycott that includes about 50 countries, including West Germany, Canada, and Japan.

The Soviets have been under unremitting diplomatic pressure to end the intervention. The White House called an embargo on most trade and stopped shipment of millions of tons of feed grain badly needed by the Soviets to make up harvest shortages last year.

The Tass announcement is sure to bring a flurry of high-level diplomatic activity between Moscow and the West to evaluate the extent and meaning of the withdrawals. Last year, Moscow announced a reduction of 20,000 troops in its East German units, but Western sources say the Soviets, while withdrawing those troops, have in fact added more.

It was impossible this morning to determine whether the withdrawal would lead to an eventual political settlement by Moscow.

The Kremlin has spurned repeated attempts by Western nations and the Moslem countries for some sort of policitcal settlement. In harsh terms, it recently rejected an initiative by the Moslems for talks that could lead to a pullout and some framework of political guarantees that could solve the dispute.

The Soviets intervened in Afghanistan on Dec. 27 in a massive airborne operation into Kabul that installed Barbrak Karmal as leader of the Marxist Afghan government and toppled Hafizullah Amin. The invasion forces since have secured the Marxists against a spreading Moselem tribal rebellion, but battles have been reported at key places around the country between Soviet troops and the Afghan rebels, who are poorly armed.

The invasion plunged U. S.-Soviet relations to their lowest point since the Cold War. President Carter has repeatedly said there can be no progress toward resumption of crucial strategic weapons talks or other matters until the Soviets are out of Afghanistan.

The Kremlin Politburo has insisted until now that the troops cannot be withdrawn fully until there are international guarantees against alleged U. S. and Chinese-backed subversion of the Marxist Babrak government. The Kremlin has previously rejected every attempt from West European and Moslem nations to seek a political settlement.

The Soviets have never disclosed how many troops they have in Afghanistan, insisting they were sent only in legal response to repeated requests for assistance from Kabul.