Afghan President Babrak Karmal today said U.S. pressure on Pakistan not to talk directly with his government was impeding a settlement of the six-year-old war in his country.

Babrak, here to attend the 27th Communist Party Congress, also said at a news conference that Soviet troops would leave his country as soon as the United States and other countries stopped backing antigovernment forces.

"As soon as this interference is put to an end, the Soviet troops will be withdrawn as soon as possible," he said. The Afghan leader would give no details on a proposed timetable for a Soviet troop withdrawal that Soviet leader Gorbachev this week said had been agreed on by Moscow and Kabul.

"The Soviet Union and Afghanistan are ready to discuss a timetable for troop withdrawal," Babrak said without elaboration.

Pakistan and Afghanistan have been holding indirect talks through U.N. mediation. Babrak said the Afghan side had shown "flexibility" during the sixth round of talks, and noted that "if Pakistan was not under the pressure of the United States and agreed to talk directly with our country, the sooner a political settlement could be found."

Babrak said his government now had the backing of "an absolute majority of our people, including workers, businessmen and religious leaders."

He also noted that "the path of negotiation is always" open for those "counterrevolutionaries . . . who admit they are guilty."

"We are conducting negotiations now," he said, adding that 5,000 "ex-bandits" had laid down their weapons in the last three months and been accepted by the government side. "They are considered children of the country," he said.

But he said there would be no compromise with those employed by the CIA and other "imperialist forces." Today he said the Army was fighting 150 "gangs" trained and armed by the United States.