Islamic foreign ministers opened an annual conference here today by strongly condemning both the Soviet invasion of Afghanistan and the abortive U.S. hostage rescue operation in Iran.

Conference chairman Aga Shahi, Pakistan's de facto foreign minister, denounced Western economic sanctions against Iran and cautioned that any further U.S. military action to free the hostages would have "incalcuable consequences" in the region.

The delegates, however, saved their sharpest criticism for Israel.

The 38 Islamic states attending the conference are expected to request a special emergency meeting of the U.N. Security Council on the vote last week of the Israeli parliament reaffirming Jerusalem as the capital of the Jewish state, a move that a spokesman here called a direct challenge to the Moslem world.

Israeli occupation of Arab land and attempts to get a homeland for the Palestinians, the Soviet invasion of Afghanistan, the U.S. economic boycott of Iran and Washington's threat to use force to free 50 American hostages held at the U.S. Embassy in Tehran since November emerged as the major issues facing the conference.

"Israeli aggression, expansionism and the usurpation of Arab and Palestinian lands have become more outrageous," said Aga Shahi.

"Soviet occupation forces in Afghanistan have been further augmented and an ever-increasing number of Afghans are being driven to seek refuge in Pakistan," he added. "Iran has experienced a flagrant act of violation of its sovereignty and territory by the United States and is also being threatened with wider economic sanctions."

Aga Shahi, who as chairman shaped the strong condemnation of the Soviet Union by a special meeting of the foreign ministers in January, asked the conference to demand that the United States drop its economic boycott of Iran over the hostage issue and stop threatening the use of force.

He called America's economic sanctions and the prospect that they will be joined by Western European nations "another manifestation of intimidation and pressure that are being exerted against the Islamic Republic of Iran.

"I would like to reiterate the solidarity of my country with Iran in this critical hour of its history," Aga Shahi said.

Despite the anti-American rehtoric on the hostage issue, however, there were indications today that the Islamic world would like to take a more active role to obtain the hostages' release. At January's special meeting, foreign ministers from a half dozen states lectured Iran on the evils of taking diplomats hostage.

While the lectures are unlikely to be repeated at this meeting, there are moves to set up a special committee of the Islamic conference to try to mediate the U.S.-Iranian crisis, which many leaders here feel has a destabilizing influence on the entire Middle East and is preventing Iran from focusing on the threat to its own borders from the Soviet invasion of Afghanistan.

"We feel that the issue of the hostages can be resolved only through mutual consultation and peaceful negotiations, and not through use of force, or the threat of the use of force," Pakistani President Mohammed Zia ul-Haq told the conference.

Aga Shahi praised "restraint" shown by Iran after the aborted American attempt to free the hostages and said he hoped that the "United States will refrain from any further resort to force, for military action could lead to incalcuable consequences."

But as an example of the evenhanded approach it appeared the conference would take, Aga Shahi called for the withdrawal of both Soviet and American naval forces from the Indian Ocean. He denounced recent naval buildups there by both countries.