In a move demonstrating the depth of its concern about the Soviet invasion of Afghanistan, the 34-nation Islamic conference meeting today called on the United States and Iran to find a "peaceful solution " to their differences and avoid further destabilization of Asia. The conference, which ended three days of closed-door sessions today, reportedly criticized Iran for holding the American hostages and indirectly chastized the United States in a resolution opposing economic sanctions against Iran or any other Islamic country. At the same time, the conference issued only a comparatively mild condemnation of the Camp David accords and the Egyptian-Israeli peace treaty, a subject that previously had been the center of Islamic, and especially Arab, denunciations.

Instead, the Moslem-majority nations reserved their harshest criticism for the Soviet Union, naming that country nine times in a five-page resolution on Afghanistan.

In an attack led by Iraq, a string of Moslem nations criticized Iran for the "un-Islamic" act of holding the hostages. Iraq's delegate said bluntly that the crisis was no longer an internal Iranian affair, but an international issue.

The hostage situation, the Iraqi delegate said, had contributed to the unstable climate in the whole region -- a climate in which the Soviet Union felt able to intervene militarily in Afghanistan.

Iran had attempted to focus the attention of the conference on U.S. economic sanctions rather than the seizure of American hostages.

The meeting of 34 Islamic nations and the Palestine Liberation Organization expressed its "sincere wish that the Islamic Republic of Iran and the United States would resolve the outstanding problems between themselves by peaceful means."

Without naming the United States directly, the conference also declared "firm opposition to any threat or use of force or any kind of intervention or interference or the imposition of economic sanctions against the Islamic Republic of Iran or any other Islamiccountry."

The United States has frozen Iranian assets in U.S. banks and halted all oil purchases from Iran in the wake of the Nov.4 hostage seizure.

Sources in the closed conference hall said Iran was told in clear language by other Moslem countries that it was wrong to hold the American hostages.

"I think they got the message," said one delegate. "This is the first time they have ever heard some of those views straight from the shoulder."

Conference chairman Agha Shai, from the host country of Pakistan, characterized the debate on the Iranian issue as "sharp and vigorous."

Iran had insisted ona discussion of U.S. economic sanctions as its price for attending the conference. When some delegates said they also wished to consider the hostage issue, Iran replied that was purely a domestic matter, sources said. A number of nations, however, isisted that the issue had international repercussions threatening other Moslem states, since the United States now had a fleet in the Indian Ocean and the Soviet Union had moved into Afghanistan.

Conference chairman Agha Shahi said that Saudi Arabia lobbied behind the scenes both to persuade Iran to free the hostages and to make sure that the resolution on the Iranian issue was evenhanded.

Iranian delegates dismissed the criticism by fellow Islamic nations by suggesting the critics were "secret agents" of the United States. "What do you expect from spies?" one Iranian official asked.

Although Agha Shahi said the Islamic world wished to be balanced in its dealings with the two superpowers, it was obvious here that the Soviets had engendered more ill will among nonaligned and Third World nations by their march into Afghanistan last month than any other action they have taken since World War II.

Seven members of the 42-member Organization of Islamic Countries boycotted the Islamabad meeting. They included Afghanistan, Syria, South Yemen, Uganda, Upper Volta, Guinea Bissau and Egypt (which has been shunned by most Islamic nations as a result of its peace treaty with Israel). s

"It doesn't mean we are more friendly with the United States, it just means they are more in the right this time," said one high Pakistani official in commenting on the tone of the two resolutions.

In addition to the conference's opposition to economic sanctions against Iran, the United States was ritually condemned for its sponsorship of peace moves between Egypt and Israel, which are opposed by many Islamic countries on the grounds that they promote a separate peace and fail to provide for either meaningful self-determination for the Palestinians or for Israeli withdrawal from Jerusalem, Islam's third-holiest city after Mecca and Medina.

But even such traditional Moscow allies as Libya and the PLO supported the afghan resolution condemning the Soviet Union.

Besides calling for a halt to "the Soviet military aggression against the Afghan people," the conference resolutin on Afghanistan denounced the presence of Soviet troops on the Horn of Africa -- in Ethiopia -- and demanded their immediate withdrawal.

Afghanistan was suspended from the Islamic conference, and conference members were asked to withdraw diplomatic recognition of Afghanistan until Soviet troops are pulled out of the country.

Member states were called on not to take part in the Moscow Olympic Games, and the Islamic nations were urged to help Afghan refugees and establish a fund that could be used to channel money to afghan rebel groups, although details of the fund were deliberately left sketchy.

Meanwhile in Damascus, Reuter reported that a joint Soviet-Syrian statement was issued attacking the aggressive policy" of the United States against Iran as a threat to world peace and detente.

In an apparent effort to court Iran's favor, the statement declared that "what threatens international peace and security is not the attitude of the Iranian revolution that is claiming the rights of its people, but that of the United States, which is threatening to use force against Iran and massing big units of its naval fleet near Iranian shores and in the Indian Ocean."

[The statement was issued at the conclusion of a three-day visit by Soviet Foreign Minister Andrei Gromyko.]