The deputy commander of Iranian ground forces in the war with Iraq today predicted that "the end of the war is very near," unless Iraq brings in outside military help to prop up its badly mauled Army.

In a mood brimming with confidence, Col. Ali Jamali mentioned only Jordan by name as a potential source of such aid "from superpowers or neighbors" that might drag out the 18-month-old conflict.

Surrounded by his staff officers at military headquarters here, the 42-year-old Jamali told reporters that the situation was calm following Iran's "glorious victory" in the key war sector stretching west from the city of Dezful to the border.

He said the Iraqis were retreating over the border, withdrawing men and materiel from the 860-square-mile area Iran wrested from their control in a week-long series of battles that ended last weekend.

"They are going and we are not following" them, said the English-speaking colonel, who was dressed in highly polished zipper boots and pressed fatigues and wore his hair closely cropped. He spoke to reporters in the war room of his American-designed headquarters base, an office replete with sophisticated military maps, grease pencils and pointers.

The colonel conceded that company-sized Iraqi units were still as far as 2.5 miles inside Iranian territory spread out north along the border starting at Fakqeh, the point through which Iraqi President Saddam Hussein's Army invaded Iran on Sept. 22, 1980.

Artillery inside Iraq was still laying down protective fire to cover the withdrawal of the remnants of the vanquished Iraqi Fourth Army, the colonel said. He dismissed the remaining Iraqi presence inside Iran as a "not very important problem I hope will be cleaned up in the very near future."

Jamali said 15,500 Iraqis had been captured, including 350 officers, and estimated the number of killed and wounded at 20,000, about half the Iraqi force committed to battle.

He placed Iranian casualties at "just 2 percent." Independent military analysts have estimated Iran's casualties at about double that number--between 3,500 and 4,000 killed out of more than 100,000 men committed to battle. They also say that Iraq took about 6,000 Iranian prisoners.

Besides crushing the Iraqis, the victory also has helped rehabilitate the reputation of a military that ruling Islamic clerics once distrusted because of its role as the principal bulwark of the late shah.

Glimpses of the former battlefield from an Iranian helicopter give few hints of last week's carnage. All the bodies have been buried and almost all the hundreds of abandoned or knocked-out Iraqi tanks and armored vehicles that littered the area have been recovered by Iranian salvage crews.

The rich irrigated farmland and desert where the fighting took place was green with young wheat and vegetables and dotted with short-lived red, yellow and violet wildflowers fed by recent rains.

Iranian flags flew over wreckage of radar towers and buildings that Iraqi forces blew up before retreating. The Iraqis abandoned two such sites, which sit atop hills and dominate flat plains below.

It was at these sites, the principal objectives of the operation code named Undeniable Victory, that Jamali said the fighting turned in Iran's favor.

After infiltrating infantry and armor behind Iraqi units under cover of darkness March 22, the Iranians benefited from what Jamali conceded was immense luck.

Jamali, who said he based his account on statements made by captured senior Iraqi officers during interrogation, said the Iraqis at the radar site had been expecting attacks, but relaxed their guard at about 3 a.m. when nothing happened.

When the attack took place an hour later, the Iraqis were asleep and never recovered the initiative. The colonel said the demoralized defenders faced the Iranian onslaught from two directions--from the east, which they had expected, and from the north, which they had not.

With the radar sites in Iranian hands after two days of fighting, the colonel said of the Iraqis, "I think they lost their self-confidence and believed they could not fight any more."

Four captured, high-ranking Iraqi officers interviewed in Ahwaz indirectly confirmed that they had been surprised at the Iranian tactics, which included little initial artillery but hinged on massive nighttime infiltration of the Iraqi rear by infantry and armor. But the Iraqis insisted their troops had fought well and said their initial positions had been strong.

Interviewed were retired Gen. Dakhil Ali Hilali, called back to active duty to command the 11th Special Mission Brigade; Col. Nariman Bakr Sami, commander of the 96th Infantry Brigade; Brig. Gen. Khatab Omar Najim, commander of the 60th Armored Brigade, and Mudar Yussef Mohammed Ali, director general of the state water organization, who commanded a unit of the so-called "people's army" backing up the Iraqi regulars.

The unmistakable impression that emerged from their accounts was that the Iranians had succeeded in smashing communications among Iraqi units by concentrating on attacking headquarters.

Najim lost control of the three units under his command when the Iranians penetrated his lines at night, then in the morning "demolished my headquarters and my communications with higher headquarters" while leaving his front-line positions untouched.

"In the modern science of warfare," Hilali said, "when something happens to roads, headquarters and communications, it's like something exploding in an engine and bringing everything to a halt."

Hilali said he fought on for three more days nonetheless until his ammunition was exhausted, then surrendered.

Ali, the water specialist, philosophically accepted his fate. He had arrived for duty only two days before the attack. "Each man with an important position in government has to prove himself in this war," he said, reflecting the philosophy of Iraq's ruling Baath Party. "It was just my luck."

When the fighting started, Ali said, he was completely cut off with his lightly armed unit, with no radio contact or food and suffering from cold, rainy weather. He estimated his 300-man unit lost "about 100 and a bit more" troops either captured or killed.