Iran early this morning announced that all outgoing air, sea and land traffic would be banned but left airlines and other carriers in a state of confusion by a series of conflicting announcements.

The state radio first announced last night that there would be a one week ban, which was immediately denied by the office of President Abol Hassan Bani-Sadr. Then early this morning a presidential spokesman confirmed that traffic would be stopped but said the duration would be 48 hours.

An abortive coup attempt reported by the government last week was given by the radio as the reason for the border closure.

For airline and airport officials the situation was baffling. They all said they had not been officially notified of the closure by the government. Some did not know about the ban and others only learned about if from a special bulletin at the end of the evening radio news at 9:40 p.m.

That was enough for Air France, however. The French Airline diverted a Boeing 747 flight, which was due to arrive here from Paris at 11:30 p.m., to Kuwait. It could not be determined immediately how many passengers were aboard the plane.

An official at Tehran's Mehrabad Airport said the decision to divert the plane was made by the airlines, not the airport control authority.

It was apparently a fortuitous decision because the later information from the president's offices said planes, ships, trains and vehicles would be allowed to enter the country but would be forced to stay for the duration of this 48-hour ban.

That means that any passengers planning to continue beyond Tehran on incoming flights will be stranded here until Friday morning. The last international flight reportedly left Mehrabad at 9 p.m.

[Iran Air and British Airways told Reuter news agency in London that their Iranian flights would go ahead as scheduled until they received instructions to the contrary.]

It was not known what action the government planned to be able to capture alleged plotters in the coup or how effective such a short ban could be.

The confusion began when the government radio broadcast an announcement from a revolutionary prosecutor general, Ali Ghodusi, that said, "From this minute we are closing all borders" to prevent any plotters involved in the abortive coup from leaving the country."

A presidential spokesman who declined to be identified said early this morning that the radio broadcast was the first information Bani-Sadr had received on the closing.

Contacted shortly after the announcement, presidential spokesman Ali Garmaroudi said no such order had been issued.

"Only the president can give the order and he has not decided yet," Garmaroudi said. He added that Bani-Sadr was meeting with the Revolutionary Council at that minute to discuss the ban.

The meeting ended at 1:10 a.m. and shortly afterward another presidential aide said the council had ordered the ban to take effect at midnight but only for 48 hours.

"Nobody was against the decision, just the duration," he said.

The aide could not explain how the incorrect announcement got on the radio without the knowledge of the president. He merely said, "The government authorities should answer that question," ignoring that he was such an official.

It would appear that the revolutionary committee entrusted with tracking down those involved in the alleged coup forced Bani-Sadr's hand by getting the announcement on the radio.

Since Bani-Sadr took office six months ago, he has had to fight a constant rear-guard action against Revolutionary Council and vigilante groups, often virtually self-appointed, that seek to act with executive authority.

No previous action, however, went so far as to close off the country from to outside world.

About 130 international flights leave Tehran each week, meaning that probably more than 3,000 passengers will have to delay their departure plans.

Thousands of Iranians traditionally try to escape the country's searing summer heat by traveling mainly to Europe. This year the number has been swelled by middle class residents unhappy with the Islamic republic of Ayatollah Ruhollah Khomeini. Some are especially seeking to avoid the rigors of Ramadan, the Moslem month of daytime fasting that began yesterday. The government is seeking to enforce the rituals rigidly.

The order will also affect oil tankers and could cause some slight disruption in Iran's oil exports. Oil Minister Ali Akbar Moinfar announced yesterday that the country's exports had climbed to 1 billion barrels a day, valued at more than $30 million. Supertankers that ply the Persian Gulf carry more than two day's worth of export oil production from Iran.

The government has given massive publicity to the alleged coup attempt ever since Bani-Sadr announced it last Thursday. About 10 persons were reportedly killed, mainly near an air base in Western Iran, where the government says the coup was to begin.

About 300 persons have been arrested, including two generals, but the government has provided no documentary evidence of the coup attempt.

Many diplomats doubt that a serious coup attempt occurred but rather feel that elements in the government are using it either to rally support for Bani-Sadr or to further purge the armed forces, which have been badly demoralized since the overthrow of Shah Mohammad Reza Pahlavi.