Soviet Foreign Minister Andrei Gromyko asserted that Moscow will withdraw its military forces from Afghanistan after receiving guarantees that there will be no outside interference in internal Afghan affairs, qualified diplomatic sources said today.

Gromyko made the assertion during a long private meeting with Pakistan's Foreign Minister Sahabzada Yaqub Khan here yesterday. At Gromyko's suggestion, only he and Yaqub Khan were present in the room during the talks, which lasted more than two hours and focused entirely on the question of Afghanistan, according to the sources.

Gromyko is said to have reiterated Soviet charges that the United States and other countries are using Pakistani territory to help insurgents in Afghanistan, which Yaqub Khan denied.

The Pakistani minister is said to have told Gromyko that Moscow could send observers to verify Pakistan's position. He also reportedly told Gromyko that Pakistan is not able to seal off the Pakistani-Afghan border, and he invited the Russians to seal off the border.

Yaqub Khan also asked Gromyko about the timing of Soviet troop withdrawals if the required guarantees were to be extended, the sources said. The Pakistani instead suggested that several aspects of a possible resolution to the Afghan problem should be carried out simultaneously.

The Pakistani official reportedly assured Gromyko that Pakistan is sincere in its efforts to find a solution and that Pakistan has been burdened by the problem of nearly 3 million Afghan refugees who, Yaqub Khan said, should return to their homes.

But Yaqub Khan said that, apart from the question of Soviet troop withdrawals, Pakistan insisted that Afghanistan be guaranteed its independence and nonaligned status and that the government in Kabul be acceptable to the majority of Afghans.

While the substance of the talks between Gromyko and Yaqub Khan appeared to have broken no new ground, observers here suggested that the tone of Soviet remarks was conciliatory and that Gromyko did not reject Pakistan's suggestion of simultaneous withdrawal of Soviet forces with guarantees of noninterference.

Apart from their private session, Gromyko and Yaqub Khan, accompanied by aides, discussed a series of international questions yesterday afternoon.

Gromyko was said to have described the Persian Gulf war as a "senseless conflict, only bringing misery and bloodshed" to both Iraq and Iran, adding that "others are profiting from it."

The Soviet minister left a clear impression that Moscow is strongly favoring Iraq, the sources said. Gromyko is said to have told the Pakistanis that Moscow had contacted Iran in an effort to bring an end to the war but that "the Iranian leadership is not ready to end the war or make any conciliatory gestures."

Yaqub Khan, who served here as ambassador in the early 1970s and who speaks Russian, was given an unsually warm reception, according to Pakistani sources. Yaqub Khan left last night.