Col. Ayad Shaaban, the paratrooper in command of Iraqi forces in this bitterly contested Iranian port city, had just started sketching a rough map of his positions when there was a distinct change in the tone of the booming Iraqi artillery that had been whistling all morning over his forward command post into the city center.

"Isn't that incoming?" said a wincing visitor who suddenly noticed a new and sharper sound, ominously nearer, amidst the boom of Iraqi artillery.

The dapper colonel, with a purple paratrooper's beret perched jauntily on his head and a pencil-thin mustache under his aquiline nose, smiled condescendingly and said confidently: "Out."

At that instant, the shell-pocked fertilizer plant outbuilding that serves as his command post here was rocked by an explosion so near that concrete dust drifted from the ceiling and there was a whir of shrapnel cutting through the air outside the paneless windows of the shuddering building.

Grabbing his Soviet-made AK47 assault rifle, the colonel scurried out of the building, with his aides in close pursuit, to plunge wildly into a sandbagged bunker in the plant courtyard.

Despite earlier claims that only "small pockets of Iranian resistance" remain to be mopped up by his forces in the city, the Iraqi general headquarters was under direct attack from a column of five British-made Chieftain tanks charging down the city's main street.

After nearly two weeks of war between Iran and Iraq and 10 punishing days of siege of the strategic Iranian port on the Shatt-al-Arab waterway, the two OPEC nations' forces are locked in a savage seesaw battle for control of this city. Khorramshahr itself appears empty of its normal 150,000 inhabitants, and today it seemed that the only people here where troops of both sides, furiously engaged in a war of thrust and counterthrust in the city core.

During today's attack, Col. Shaaban, with a telephone communications aide at his elbow relaying his orders, coolly directed the defense of headquarters over the frenzied shouts of his troops as they scampered to man positions around the partially destroyed fertilizer plant compound.

A line of paratroopers and special forces riflemen, lying flat on a bulldozed dirt embankment on the far edge of the compound, opened up with a staccato of automatic AK47 rifle fire against the Iranian forces that had moved out of the center of Khorramshahr, which is still very much in their hands.

From the rear, Col. Shaaban ordered a force of T55 tanks to begin firing from their positions dug in along both sides of the narrow and exposed paved road that leads west to the city outskirts. Other tanks, some more modern T62s dug in around the command post, noisily joined in. Iranian shells arched into the compound, shaking the earth with their concussions.

For 30 minutes the close-quarters firefight raged, punctuated by shouts, the rattle of machine gun fire, the hollow spatter of AK47s, and the shuddering crash of cannon shells.

During a sudden lull, an Iraqi soldier, smiling, told four U.S. correspondents who had huddled for protection in a concrete crawl space under the building's floor that everything was safe and they could come out. "Welcome," he said as they shook themselves clear of dust, "welcome to Iraq."

The attacking tanks had all been knocked out by rocket-propelled grenades, a helmeted lieutenant colonel in the Iraqi special forces said.

The lead Iranian tank, the only one to be seen from the headquarters' trenches, was indeed immobilized, with a shell through the turret, only 200 yards from the command post.

"The battle was not over, however. Another two shells suddenly slammed into the compound, sending everyone scurrying for cover a second time. This attack, as violently cacophonous as the first, lasted only 10 minutes, after which another soldier anounced: "Guns of Iran finished."

The second aattack, the special forces lieutenant said, came when the Iranian forces, made up of the lead commandos and tankmen who have recently reinforced motley Revolutionary Guard units in the city, moved up the road again in an effort to pick up their wounded. The new advance was repulsed when an Iraqi tank knocked out the armored personnel carrier leading the Iranian force.

Hardly had the last shell slammed into the headquaraters compound, when a major general, the overall commander of the Khuzestan Province front, rattled into the fertilizer plant in a Soviet-made armored personnel carrier, escorted by two small armored cars.

The general, dressed in freshly starched khakis with a swaggerstick tucked under his arm, was quickly briefed on the attack by Col. Shaaban inside the outbuilding.

He then climbed back into his vehicle and, standing erect in an open turret hatch, delivered a few brief words of encouragement to the officerts and enlisted men who stood around his vehicle.

"Your commander is standing behind you," he said. "The party is behind you. We salute you." With that he sped off in a cloud of dust, heading west out of Khorramshahr, toward Iraqi rear.

It remained unclear how many soldiers were killed or wounded in the sudden battle. "There were many wounded, but not many dead," a helmeted combat doctor said afterwards, refusing to be more precise. "This is war, of course, this is the front line."