President Saddam Hussein charged today that the United States and the Soviet Union have done nothing to stop the war between Iran and Iraq.

At a press conference with visiting American correspondents, Saddam Hussein accused the United States of trying to harm Iraq by doing nothing to stop the war.

Western diplomats here, expressing surprise and concern, said that the Iraqi president's criticisms of the United States were the harshest in a year and suggested that he was seeking to pressure Washington somehow to convince Iran to call off its attacks.

The president charged that the Soviet Union also was refusing to try to bring the war to a close. He said that the 10-year-old Soviet-Iraqi friendship treaty had failed to work in the Persian Gulf war.

Saddam Hussein's comments appeared to reflect a growing sense of isolation and helplessness now that his massive invasion of Iran 25 months ago has backfired.

Iranian troops, after forcing Iraq to withdraw from virtually all of Iran last June, now stand poised on the border and threaten to invade. "We have tried all means [to stop the war]. We have knocked on all the doors," Saddam Hussein said.

Iraqi forces repelled an Iranian advance last night and this morning near the border town of Mandali, 75 miles northeast of the capital, according to reports from both sides.

An Iraqi corps commander said his troops had crushed a five-pronged Iranian assault that had aimed to push through a valley and into Iraqi territory. He claimed that his forces killed 3,400 enemy soldiers out of an attacking column of 8,000. But there was no way to confirm the figures.

Saddam Hussein said that Iraq had annihilated a "major Iranian offensive" there.

Responding to the Iranian demand that he step down as a condition of ending the war, the president declared: "I am staying even if it lasts for another 10 years. I consider this condition as silly, and it should be trampled under my foot."

Western and Arab diplomats and other observers say a negotiated settlement might be substantially easier if he were replaced. Iranian leader Ayatollah Ruhollah Khomeini is believed to hold a personal grudge against him, both because the Iraqi president launched the invasion of Iran and because he expelled Khomeini from Iraq four years ago in an effort to preserve good relations with Khomeini's enemy, the late shah.

Iran's other demands for ending the war include a complete Iraqi withdrawal, payment of $150 billion of war reparations, and repatriation of at least 20,000 Iraqi dissidents exiled in Iran.

Some diplomats and businessmen here say that most Iraqis would be happy to see Saddam Hussein go if it meant that the war could end. Casualties have been heavy, and the economy is deteriorating steadily. The president said, however, that it would be unpatriotic to resign under outside pressure.

He did not make clear how he expected the United States to prevent Iran from pressing ahead with the war. U.S. officials have said they have virtually no leverage with Iran and quietly have backed peace initiatives by the Islamic Conference organization.

Earlier this year Iraq protested that the United States should halt Israel's supplies of arms to Iran, but these complaints have fallen off -- apparently because the Israeli shipments have not been particularly large -- informed diplomats said.

"U.S. policy is for a continuation of the war," Saddam Hussein said. Accusing the United States of sharing a policy known to be favored by Israel, he said Washington feels that Iraq "has not been sufficiently drained of its political and economic resources."

Western diplomats here said the United States regarded the president's comments as worrisome, partly because Washington has been seeking to restore diplomatic relations. The United States currently has an interests section in Baghdad instead of an embassy. Iraq and South Yemen are the only Arab countries that have not restored full diplomatic ties with the United States after breaking relations during the 1967 Arab-Israeli war.

The president indicated that Iraq had intended to restore ties when it took over chairmanship of the Nonaligned Movement. But a summit of the movement scheduled here in September was canceled due to the war. Baghdad has full relations with Moscow, and, had it become host of the Nonaligned Movement, would have wished to appear equidistant from the superpowers.

Today, Saddam Hussein said that Iraq could not have relations with the United States until Washington ends its "bias" in favor of Israel against the Arabs and stops opposing an end to the Persian Gulf war.

The public U.S. position is that it seeks a restoration of relations without preconditions. Informed diplomats suggested that the U.S. stance against preconditions might prove embarrassing if Iraq accepted at this time because of the recent return to Iraq of Abu Nidal, the Middle East's best-known terrorist.

Saddam Hussein at one point called both the United States and Iran "evil forces."

His language was less strident in referring to the Soviet Union, which supplies well over half of Iraq's arms under the 1972 treaty. But he said Secretary of State George P. Shultz and Soviet Foreign Minister Andrei Gromyko both were being deceitful when they reported jointly after a meeting at the United Nations earlier this autumn that they were seeking an end to the war.

"When two superpowers agree to stop a war, and yet the war goes on, that means they have hidden designs and that what is being said is not what exists," Saddam Hussein said.

He declined to say why Iraq was disappointed with the treaty with Moscow, but Iraq clearly was upset when the Soviets shut off the supply of arms at the start of the war when the Iraqis were driving deep into Iranian territory. The Soviets reportedly were expecting the Iraqi population to resist the war and overthrow Saddam Hussein, and Moscow was trying to cultivate Iran.

Moscow resumed shipments of spare parts and ammunition in the spring of 1981. Shipments have picked up this year.