The Iraqi government tonight ordered most of the foreign journalists who are covering the war between Iraq and Iran to leave the country by Saturday.

With the exception of major American and European newspapers, wire services, television networks, and magazines, all correspondents who have been in Iraq for more than five days were ordered to leave Baghdad by bus for Amman, Jordan. The correspondents were told that they may then reapply for reentry to Iraq to cover the war.

The Iraqi government, which scored a propaganda coup in the early stages of the war with Iran by admitting scores of foreign journalists to the war front, is discovering unforeseen public relations perils now that the heady days of early victories are over.

With the war front on the fringes of Khorramshahr mired in a stalemate with tenacious Iranian Revolutionary Guards and the Iraqi Army command as yet unwilling to launch a costly offensive in the south, the government is frantically trying to put a lid on the freewheeling news coverage that marked the beginning of the conflict.

Harried officials of the Ministry of Information, who have been trying to cope with an unprecedented influx of foreign correspondents are waging an uphill battle to identify and round up scores of journalists and put them under closer supervision -- or out of the country.

In a meeting tonight with 100 foreign correspondents, officials of the Ministry of Information made it clear that they intend to pare down the size of the press contingent covering the war. They offered no explanation or motive, but observers suggested that a possible offensive on the stalemated Khorramshahr front may be behind the decision.

The official explanation is that the ministry is anxious to rotate correspondents who have been here for weeks, and admit hundreds of others who are waiting in Amman and other foreign capitals to get in. But behind the official explanation there appears to be a desire to turn attention away from the Iraqi Army's lack of advancement in Khorramshahr and establish a more rigid flow of propaganda to the world news media.

Even in the best of times, gaining access to information in Iraq is a challenging task. But in this war, foreign journalists were pleasantly surprised to find in the southern port city of Basra relatively easy access to front lines of fighting, with a minimum of control.

Later, the Ministry of Information stepped in and put considerable organization into the exercise, arranging daily guided tours by bus to the front and by setting up carefully staged exhibits of captured Iranian soldiers and enemy weapons.

But today, after days of rumors that the honeymoon would soon be over, the ministry launched what has been dubbed The Big Sweep, a roundup of about 50 correspondents in Basra who were marked for forced transfer to Baghdad.

Since the start of the war, correspondents based here have been tightly restricted on their movements, and have been provided with little more opportunities than to glean official statements and communiques, interview Western diplomats, who themselves are often isolated from official sources, and monitor radio reports and dispatches of the official Iraqi News Agency.

In the first stages of the roundup in Basra, correspondents became practically invisible as far as information officials were concerned. Many simply took long walks, as the authorities combed the hallways of the Hamdan and Shatt-al-Arab hotels looking for people to put on Baghdad-bound buses. Excuses began flowing and ministry officials found themselves confronted with long-time journalistic colleagues who experienced sudden memory lapses and were unable to remember the whereabouts of their friends.

A similar sweep by ministry officials in Baghdad began today in the Mansour Melia Hotel, where all correspondents working in the capital have been housed. This afternoon, ministry officials began announcing over hotel loudspeakers that all journalists who have been here five days must register for transport to Jordan Saturday.

Response was less than overwhelming. As reporters sidled toward the elevators and out of sight, ministry officials began looking in the lobbies and the bar for people whose faces had become familiar. There seemed little likelihood that the authorities could track down all of the journalists who have time remaining on their two-week or 30-day visas.

However, the outcome of tonight's meeting between correspondents and officials remained uncertain, as representatives of Third World newspapers and television sought a greater representation on the list of journalists who will be allowed to remain.