PARIS, JULY 27 -- France today freed a Lebanese Moslem terrorist and four accomplices convicted in the killings of two people during an assassination attempt ordered by Iran 10 years ago. Iran had long sought their release.

French President Francois Mitterrand ordered the release of Anis Naccache and four accomplices. The five, jailed for the past 10 years, immediately were put on an Iran Air flight for Tehran, the Justice Ministry said.

Naccache had gone on a 19-week hunger strike, ending in January, in a bid to obtain his freedom. During the fast, his weight dropped from 164 to 105 pounds. According to unconfirmed press reports, he resumed eating after obtaining assurances he would be freed this year.

Naccache and three members of his group were sentenced to life imprisonment for a July 18, 1980, attempt to kill Shahpour Bakhtiar, Iran's prime minister before the 1979 Islamic revolution. A fifth member of the team, who did not open fire during the attempt, was sentenced to 20 years in prison.

Bakhtiar escaped injury and still lives in Paris, where the attack occurred. But a policeman and a bystander were killed and three people were wounded, including a policeman who remains paralyzed.

Both defense and prosecution said at the trial that Naccache and his team were acting on orders from senior Iranian officials.

The Justice Ministry announced the releases in a two-sentence communique which said the five "have benefited from an act of clemency after having spent 10 years in prison. They have been issued an order of expulsion from French territory which was carried out today."

Naccache was one of three prisoners whose freedom was demanded by a group calling itself the Committee for Solidarity with Arab and Middle East Prisoners. The group claimed responsibility for bombings in Paris in 1985-86 that killed 13 people and injured more than 250.

Ten people involved in that bombing campaign received prison sentences of varying lengths at a trial earlier this year.

Naccache and high-ranking Iranian officials contended that his release was part of a 1988 deal that won freedom for all French hostages then held in Lebanon.

Jacques Chirac, France's prime minister at the time of the hostage release, denied that Naccache's freedom was part of the package, which included resolutions of bilateral financial disputes.

Renewed appeals for Naccache's freedom came in April, after the release in Beirut of Frenchwoman Jacqueline Valente, her Belgian boyfriend, Fernand Houtekins, and their daughter, Sophie-Liberte.

Those three were freed April 10 by members of the Fatah Revolutionary Council, a radical Palestinian group led by Abu Nidal and backed by Libya.