The new Indian government of Indira Gandhi broke ranks with the rest of the noncommunist world here tonight by virtually endorsing the Soviet invasion of Afghanistan and denouncing those "outside powers" that have backed "subversive elements" there.

The Indian speech to the U.N. General Assembly's emergency special session, was dictated from New Delhi and delivered verbatim by the Indian representative, Brajesh Mishra. It represented a departure in policy not only for India but for Prime Minister Gandhi herself. During her election campaign, Gandhi had criticized the Soviet move.

U.S. representative William Vanden Heuvel called it "a great disappointment." It was an even greater disappointement to the Yugoslavs and other members of the nonaligned movement, since it represents a major split in their ranks.

"India cannot look with equanimity," Mishra told the assembly, "at the attempt by some outside powers to interfere in the internal affairs of Afghanistan by training, arming and encouraging subversive elements to create a disturbance inside Afghanistan."

Moscow has assured the new Indian government, Mishra said, that Soviet troops entered Afghanistan at the request of the Hafizullah Amin government on Dec. 26, and of Amin's successors on Dec. 28.

"We have been further assured that Soviet troops will be withdrawn when requested to do so by the Afghan government," Mishra said.

Mishra said that India has no reason to doubt these assurances, "particularly by a friendly country such as the Soviet Union." He expressed the hope that the Soviets "will not violate the independence of Afghanistan and that Soviet forces will not remain there a day longer than necessary."

The Indian representative warned that the unity of the nonaligned movement and his country's own security were threatened by the "building of bases, the pumping of arms to small and medium countries and interference to U.S. and Chinese responses to the Soviet move, including offers to aid to Pakistan.

As the second day of debate ended, 29 nations had spoken in the session convened by the Security Council when its attempt to condemn the Soviet invasion was stymied by the Soviet Union's veto on Monday. Voting on a resolution submitted by 17 Third World countries is expected tomorrow, after another 40 nations have spoken.

This resolution, similar to the one blocked in the Security Council, strongly deplores armed intervention in Afghanistan, and calls for the immediate withdrawal of foreign troops. It requires a two-thirds majority for adoption, which its sponsors maintain is easily within reach. But it does not carry the force of international law that a council resolution would have had.

The only countries other than India that supported the Soviet position today were East Germany, Vietnam and Angola, all allies of Moscow.

Soviet Ambassador Oleg Troyanovsky took the rostrum to denounce the United States even more harshly than he had in his statements to the Security Council.

Troyanovsky blamed Pakistan, China and the United States for "a conspiracy to overthrow the popular government of Afghanistan."

The U.N. debates, he charged, were part of a "trumped up campaign" by the United States "to destroy the concept of detente and peaceful coexistence." He cited increased American military spending and the deployment of medium-range nuclear missiles in West Germany as other anti-Soviet moves that "will fail, as similar measures have failed in the past."

Most of the other speakers today strongly denounced the Soviet Union, blaming it for the threat to international cooperation and detente posed by the Afghan crisis.

P. Akporode Clark of Nigeria prefaced his condemnation with the observation that his government felt a "great sense of disappointment," because "no country had assisted the Third World more than the Soviet Union."

The fact that this recognition of Soviet assistance was put in the past tense by Clark appeared to symbolize the Third World's attitude toward the changed international situation.