Iraq's Army, defending its own soil for the first time in the war with Iran, is apparently fighting with new-found resolve and has driven back three major offensives since the Iranian invasion 26 days ago, U.S. officials report.

The fighting has been fierce, with thousands of soldiers killed on each side. Iran reportedly has suffered significantly higher losses than the Iraqis, probably because its use of massed infantry assaults against dug-in defenders has exposed Iranian troops to devastating fire from artillery, tanks and machine guns. U.S. officials are skeptical, however, of Iraqi claims to have killed more than 27,000 invaders.

Iran's thrust also has been frustrated by the apparent lack of interest of Iraq's Shiite Moslems in calls by Tehran's Shiite leaders for an Islamic revolution. Iraq's President Saddam Hussein--a Sunni Moslem whom Iran has vowed to topple--brought additional Shiites into the nation's leadership in late June in an apparent bid to expand his power base.

Iraq's recent stiff defense has heartened U.S. officials and Washington's friends in the Persian Gulf, who are jittery about Tehran's stated wish to export its Islamic revolution. The containment of the invasion is "a plus for stability in the area, and that redounds to our benefit," a U.S. official said.

Iranian leader Ayatollah Ruhollah Khomeini predicted soon after its forces pushed into Iraq's southeastern corner that they would drive to Baghdad and on to Jerusalem. Some Western analysts agreed that the Iranians would do well, noting the poor performance of Iraqi troops earlier in the year when virtually all of them were pushed out of Iran. Iraq had invaded Iran in September 1980 at the war's start.

Back in their own territory, however, Iraqi soldiers stopped dropping their weapons and running, as they frequently had done in fighting inside Iran, U.S. officials with access to intelligence reports say. Instead, the Iraqis have held their ground or retreated slowly, waited for reinforcements and counterattacked.

"The Iraqis have shown greater flexibility and maneuverability since they began fighting on their own land," one U.S. defense official said. "It could be new leadership or better morale."

As a result, Iran's troops are holding a strip of Iraqi territory only about one to two miles wide and perhaps 10 miles long, which they captured in their first thrust across the border on July 13, the officials said.

The Iraqis also have benefited from swampy terrain spotted with lakes, which slows down the invaders' tank advances. The Iranians have trouble keeping supply lines open and may have launched their attack without adequate preparation, the officials said.

The Iranians penetrated the farthest, about five miles, in their second major offensive starting July 21, one official said. They launched a third attack on July 28 but "were quickly thrown back," the official said.

Combat has dropped off sharply in the past week and a half, probably because both sides are exhausted. The Iranians appeared to have thrown the bulk of their forces against the Iraqis in the three assaults and could need weeks or months to prepare another major offensive, the U.S. officials said.

The Iraqis, who asked for a truce in June after their setbacks inside Iran, are still hoping for an Iranian withdrawal and cease-fire. They were not expected to risk heavy casualties by staging an assault of their own to drive the invaders off the small bit of land that the Iranians currently hold.

Iran's disappointments in the recent battles have been reinforced by the failure of a fifth column of Shiite Moslems to materialize inside Iraq.

More than half of the Iraqi population and nearly all Iranians belong to the Shiite branch of Islam rather than the Sunni branch, which is dominant in most of the rest of the Middle East.

At the start of the invasion, Tehran radio broadcast an appeal by Khomeini in Arabic to Iraq's Shiites to join the Iranian forces and overthrow Saddam Hussein's secular Baathist government. The invasion was aimed at the major oil port of Basra, a major Shiite center in Iraq.

So far, however, the Shiites have shown no signs of unrest, U.S. officials say. These officials and other specialists say that Iraq's Shiites are motivated by Iraqi and Arab nationalism as much as by sentiments of Shiite solidarity. Persian Iran is a historic enemy of the Arabs.

Many Shiites also prefer Iraq's secular society to what they see as the religious excesses of Khomeini's revolution.

"Even Shiites who don't like Saddam Hussein think that Khomeini's alternative looks worse," Phebe Marr, an associate professor of history at the University of Tennessee and longtime Iraq specialist, said in a telephone interview.

While Shiites make up the bulk of Iraq's poor, Saddam Hussein has been careful to build schools and hospitals in areas where they live as well as in Sunni areas. The Shiites are by no means barred from top positions in government, and Saddam Hussein--perhaps anticipating the Iranian invasion and a possible threat to his rule--replaced several members of the ruling Revolutionary Command Council in late June with Shiites who were loyal to him.

U.S. officials and academic specialists cautioned that Saddam Hussein still was identifed with the 23-month-old war and its heavy casualties, and the Shiites could jump to the Iranian side quickly if Iran's troops captured Basra.

They emphasized, however, that the secular Baathist Party had strong roots in Iraqi society and particularly in the Army, and any attempt to set up an Islamic republic would likely trigger a civil war.

It is unclear how long Iran is willing to press its invasion, U.S. officials say. Many of the ruling mullahs objected to the invasion in the first place, saying that the government should have been content with expelling the Iraqis.