PORT-AU-PRINCE, Haiti (AP) _ The government said today it freed three military commanders who led a failed coup attempt. Mutinous soldiers surrendered control of the airport and returned to their barracks.

State television announced Lt. Col. Himmler Rebu, commander of the Leopards Battalion; Col. Phillipe Biamby, commander of the presidential guard; and Col. Leonce Qualo, an administrative officer at army headquarters, were given safe passage to the United States.

A government communique identified Rebu, Biamby and Qualo as leaders of what it called a ''foolhardy'' attempt Sunday to overthrow the government of Lt. Gen. Prosper Avril.

The president ''magnanimously'' decided to release the officers and they were escorted to the border of the Dominican Republic on Monday night to get a flight to an undisclosed city in the United States, the communique said. Rebu was accompanied by his wife and four children.

The government did not explain why the three men were freed, but the move was clearly meant to defuse resistance within the Leopards Battalion. At least four mutinous soldiers in the battalion were killed Monday in skirmishes with troops loyal to Avril. The rebels were demanding Rebu's release.

Independent Radio Haiti-Inter said rebel units of the Leopards Battalion withdrew Monday night from the Port-au-Prince airport, but the airport remained closed. Schools also were closed for a second day.

Avril assumed power six months ago in a coup led by non-commissioned officers who said they were disgusted by official corruption and human rights abuses.

On Monday night, presidential guardsmen in tanks battled Leopards commandos on a main throughfare between the airport and downtown Port-au-Prince. Radio stations gave conflicting casualty reports, saying four to eight Leopards were killed and several wounded.

Nine members of an independent council appointed to organize and schedule presidential elections were to be sworn in today, but the ceremony was postponed until Thursday because of the violence, officials said.

Avril said in February he was forming the council, an announcement many Haitians welcomed as a sign of democratic times to come.

The leader of this impoverished Caribbean nation has promised elections and pointed as proof he is keeping his pledge to the council, which is to include representatives of the Roman Catholic Church, labor unions, the military, human rights groups, the media and judiciary.

Rebel soldiers made three demands over Radio Haiti-Inter on Monday. They said they wanted Rebu released, a civilian government installed and total restoration of a 1987 constitution restricting the army's role in government. Those parts of the constitution were suspended in June.

Radio Haiti-Inter cited sources close to the police command as reporting that Avril had determined a ''handful of soldiers and officers were involved'' in Sunday's coup attempt.

Avril said on nationwide television early Monday that the coup was led by ''some members of the armed forces, blinded by their exhorbitant ambitions,'' but gave no details.

Avril was seized early Sunday by rebel troops, but rescued by loyal forces later in the day. No casualties were reported Sunday.

There was speculation the coup attempt may have been linked to Avril's crackdown on drug trafficking by the military. Last week, four high-ranking army officers were accused of drug dealing and arrested.

The troops that installed Avril as president ousted Lt. Gen. Henri Namphy on Sept. 17, 1988. Namphy had led the country for most of the time since a February 1986 popular uprising forced dictator Jean-Claude Duvalier into exile, ending 30 years of Duvalier family rule.

U.S. officials have conditioned the restoration of $70 million in suspended economic aid on Haiti moving toward democracy, respecting human rights, and cracking down on the drug trade. The funds were suspended after thugs massacred 34 voters in November 1987, aborting Haiti's first elections in 30 years.