PARIS, Jan. 13 -- The French government, in a major political retreat, announced tonight that seven Iranians expelled Dec. 9 to Gabon will be allowed to return to France and that another eight will travel to Spain.

The decision by the government of Prime Minister Jacques Chirac came on the 37th day of a hunger strike by the Iranian exiles interned in Gabon and dozens of their sympathizers in Paris, London and Washington. The French government had denied on Monday that it would cancel the expulsion orders despite the protest fasts.

In a communique late tonight, the Interior Ministry said the government reversed itself "taking into consideration the state of health of those concerned and for humanitarian reasons." A number of the hunger strikers have reached a critical point after taking only sugar and water for more than a month, Iranian exiles said.

The expulsions were aimed at Paris-based militants of the People's Mujaheddin movement working for the overthrow of Ayatollah Ruhollah Khomeini's revolutionary Islamic government in Tehran, French officials said. The orders were handed down as part of an agreement with the Iranian government that led to the release of two French hostages in late November.

The communique said People's Mujaheddin leader Massoud Rajavi had promised, in exchange for permission for his followers to leave Gabon, to ask their sympathizers to end the hunger strikes here and in other capitals. Rajavi, who was forced to leave Paris in 1986, set up his movement's headquarters in Baghdad, where the Iraqi government has become his chief backer.

In a statement released in his name here, Rajavi called tonight's agreement "extremely important and precious." He thanked the hunger strikers and various political personalities who expressed concern for their health, including President Francois Mitterrand and his wife Danielle.

A People's Mujaheddin spokesman said the agreement was signed in Paris by Mehdi Abrichamchi, a member of the underground organization's executive committee, and Robert Pandraud, the French deputy interior minister for security affairs.

The Interior Ministry said the seven Iranians being allowed to return to France, probably Thursday night, will receive immediate medical care for effects of their hunger strike in Gabon.

Eight other persons -- five Iranians and three Turkish nationals of Kurdish origin who were expelled along with the Iranians -- have received authorization to leave Gabon for Spain, and the French government will consider their appeals to return to France, it added.

"They will go later to one or several European countries," the ministry said.

In all, 17 persons were arrested in Paris suburbs Dec. 8 and expelled the following day. Two held valid residence permits granted by the British and Swedish government respectively, and they left Gabon for those countries soon after their arrival.