Leaders of capitalist, Communist and nonaligned nations condemned the assassination of Indian Prime Minister Indira Gandhi yesterday and praised her as a distinguished world leader.

The death of Gandhi, one of the few major noncommunist world figures to have close relations with the Soviet Union, produced profound concern in the Soviet capital.

Soviet President Konstantin Chernenko expressed "pain and grief" over the death of Gandhi, whom he described as a "great friend of the Soviet Union."

In a message to her son and successor as prime minister, Rajiv Gandhi, Chernenko reiterated Moscow's "invariable desire" to continue its close ties with India.

East German leader Erich Honecker sent a telegram to Indian President Zail Singh saying Gandhi's death was an "irreplaceable loss" for India.

China, which fought a border war with India in 1962, expressed "profound condolences" over Gandhi's death, calling her an "outstanding statesman" who contributed to the improvement of Sino-Indian relations.

The two nations have held negotiations during the past two years aimed at untangling their boundary dispute in the Himalayan Mountains.

"We are shocked to learn the unfortunate news that Prime Minister Indira Gandhi had died from assassination," said a spokesman for the Foreign Ministry in Peking.

President Mohammed Zia ul-Haq, the leader of Pakistan, India's other Asian rival, praised Gandhi for "her valuable contributions to the normalization of relations," and ordered three days of official mourning.

In London, Prime Minister Margaret Thatcher, who narrowly escaped death in an assassinaton attempt three weeks ago, said that "only a few days ago" Gandhi had sent her a message saying that "all terrorism and violence are condemnable and contemptible."

Speaking in the House of Commons, Thatcher said Gandhi's death had robbed the Commonwealth of "one of its most formidable and vital personalities."

In addition to the fact that both leaders were targets of assassins, Thatcher and Gandhi were the only two women leading major nations and were personal friends. "I think we had a unique understanding of one another's problems," she told a television interviewer. Thatcher was expected to attend Gandhi's funeral.

Yugoslavia, which founded the Nonaligned Movement along with India, Indonesia and Egypt, expressed its "deepest grief." Other nonaligned nations joined in praise for Gandhi, who became head of the organization of nonaligned nations in March of last year, United Press International reported.

In Cairo, Boutros Ghali, Egypt's deputy foreign minister, said in a statement that Gandhi's death was "a great loss to the international community and all the noble principles underlying the Nonaligned Movement."

Yasser Arafat, leader of the Palestine Liberation Organization said, "The Palestinian people remember the firm, friendly and courageous positions she has taken and the support the prime minister always gave to our just cause."

French President Francois Mitterrand sent a telegram to New Delhi saying, "The tragic death of Mrs. Indira Gandhi provokes in me and the French people a profound pain," The Associated Press reported.

West German Foreign Minister Hans-Dietrich Genscher said in a telegram that the "criminal attack" on Gandhi "has deeply shaken me."