The Islamic foreign minister's conference appeared today to be pulling back from last January's harsh condemnation of the Soviet Union for its invasion of Afghanistan in favor of negotiations that could lead to the withdrawal of Soviet troops from that Moslem nation.

Instead of attacking Moscow, conference chairman Aga Shahi of Pakistan indicated that the foreign ministers will seek a political settlement to a crisis that has driven a wedge between the United States and the Soviet Union, raised the specter of a new cold war and threatened the security of much of the Moselm world.

As an incentive to Moscow, Shahi said the Afghan goverment could be included in the talks -- a concession that the Soviets have been pushing for in an effort to give legitimacy to the Soviet-installed government of Babrak Karmal.

The move serves as a counterproposal to Afghanistan's call Wednesday for trilateral talks with its Moslem neighbors -- Pakistan and Iran. Afghanistan said that such talks could lead to the withdrawal of Soviet troops and could serve as a reply to Moscow's charges that Pakistan is refusing to talk with Babrak's government to prolong the crisis.

Resolutions passed in January by the Islamic foreign ministers carried the harshest condemnation ever received by the Soviets from nations representing the Islamic, Third World and nonaligned countries -- a group that Moscow was assiduously cultivated for more than 30 years. The resolutions also called on Islamic nations to withhold recognition from the Babrak government, which Shahi as foreign policy adviser to Pakistani President Mohammed Ziaul-Haq, "the de facto authority."

The Soviet Union has worked hard during the last four months to persuade Moslem nations to reverse their earlier stand and Arab and Western diplomats here believe the effort has borne fruit.

The Soviet position is expected to be voiced at the foreign ministers' conference by members of the "Steadfastness Front" opposing Israel, composed of Syria, Libya, South Yemen and the Palestine Liberation Organization.

While the Soviets have scored points in the Islamic world since January, the position of the United States has fallen as a result of actions at the United Nations, the apparent failure of Camp David and the aborted attempt to rescue the American hostages in Iran.

Even Islamic nations such as Saudi Arabia that fear for their security -- with 100,000 Soviet troops in Afghanistan poised to move toward the Persian Gulf -- are considered unlikely to give full support to American positions.

Thus, this conference of Moslem nations, which officially opens here Saturday, is viewed as a contest between the United States and the Soviet Union.

While the attack on the Soviets for the invasion of Afghanistan is apt to be softened, the United States -- which received the mildest of rebuffs last January -- appears likely to take it on the chin this time for its strong support of Israel, its military attempt to rescue the hostages in Iran and its economic sanctions against Iran.

Despite the strong moves to reverse the anti-Soviet stance taken in January, Shahi said he expects the conference's demand for the withdrawal of Soviet troops from Afghanistan to remain intact.

"The central issue in Afghanistan is the withdrawl of Soviet troops, and on that I would expect complete unanimity," he said.

Shahi listed the objectives of a negotiated settlement as the troop withdrawal, the return of the almost 900,000 Afghan refugees who have flooded Pakistan in the past 18 months, the right of the Afghan people to choose their form of government and respect for the sovereignty, territory and nonaligned status of Afghanistan.

It is unlikely that the Soviets would pull their troops out unless they are sure that the Afghan government that remains would remain loyal to Moscow.

Nevertheless, the return of the refugees could be a signal to Moscow that Pakistan will make sure there are no anti-Afghan activities conducted by rebels from its territories. Moscow maintains that is was forced to move into Afghanistan because its security was threatened by Afghan rebels aided by Pakistan, China, Egypt and the United States.

Shahi said the conference could appoint a "high-powered" committee of foreign ministers to contact the concerned nations -- which could include Afghanistan -- about the possibility of a political solution.

Shahi declined to specify what shape of any political settlement might take, but he said informal talks among the foreign ministers currently are going on. Diplomatic sources here said Pakistani diplomats are working on a draft resolution calling for the political settlement.

On other issues, Shahi said some Islamic foreign ministers would meet with Iranian Foreign Minister Sadegh Ghotzbadeh "to consider specific ways for an honorable settlement of the hostage stiuation while expressing strong opposition to military action or the imposition of sanctions against Iran."

On his arrival here tonight, Ghotbzadeh said the hostage question will be among th first items taken up by the newly elected Iranian parliament.