President Najib said Friday the nation's war could end in a negotiated settlement within weeks and that representatives of his Marxist government have talked with Moslem guerrillas.

The Soviet Union said President Mikhail S. Gorbachev sent messages to President Bush and other world leaders asking for help in ending the war.The main highway connecting Kabul to the Soviet Union, which Soviet troops used to withdraw, remained open, Tass said, quoting the Afghan Bakhtar news agency. Tass, the official Soviet news agency, said more than 100 trucks carrying Soviet food and supplies were bound for the Afghan capital.

Najib also said he had sent emissaries to Rome to talk with former Afghan King Zahir Shah and that his government had been in contact with the Moslem guerrilla resistance. He did not elaborate.

Yuli Vorontsov, Soviet deputy foreign minister, gave a similar report at a news conference in New Delhi, where he met with government officials in talks aimed at ending the war between the Afghan government and the guerrillas.

Vorontsov said some guerrilla groups were in contact with the Kabul government, despite their public vows against any negotiations with Najib. "Some dealing exists already - clandestinely," he said without elaborating.

When Najib was asked by Western reporters whether there could be peace in days or months, he replied: "Maybe weeks."

But he has repeatedly insisted that any political settlement must include the governing People's Democratic Party of Afghanistan.

Some Western officials believe the Moslem guerrillas will soon capture key Afghan cities now that the Soviet troops are gone.

Alexander A. Bessmertnykh, the Soviet first deputy foreign minister, told reporters in Moscow Friday that his country appealed on Thursday to many nations and world organizations to take a part in stabilizing the Afghan situation. He said the appeals called for economic and humanitarian assistance, but he declined to describe the contents of the message Gorbachev sent to Bush.

"We believe that all countries should respond to the emerging opportunity to put an end to the drawn-out conflict by promoting the complete and fast settlement of the situation," the Soviet official said.

In Washington, Bush said Thursday that the United States will continue helping guerrilla groups in Afghanistan after the Soviet army's withdrawal. The guerrillas say the government will soon fall.