PARIS (AP) _ Five Frenchmen who had been trapped inside the French Embassy in Tehran returned home today, leaving behind three colleagues to oversee French interests in Iran, the Foreign Ministry said.

Paul Torri, first secretary at the embassy, had returned to France on Monday after the French government turned over to Iran an employee of the Iranian Embassy in Paris.

Wahid Gordji, the Iranian employee exchanged for Torri had been wanted for questioning in connection with a wave of terrorist bombings in Paris in September 1986.

The five returning Frenchmen included embassy charge d'affaires Pierre Lafrance.

The three staying behind were Vice Consul Gerard Toureille, a coding clerk, and a security guard, who would operate the French interest section in the Italian Embassy, the Foreign Ministry said.

France broke diplomatic relations with Tehran last July 17.

What came to be known as the ''Embassy War'' broke out last June 30 when Gordji refused to appear before an investigating magistrate in Paris to answer questions about his suspected links to terrorists.

The French government said Gordji did not have diplomatic status and was required to appear. Gordji took refuge in the embassy.

The French then sealed off the Iranian Embassy and the Iranians retaliated by taking the same measures against the French Embassy in Tehran, accusing Torri of being a spy.

Sunday night, Gordji was finally questioned by the French magistrate and released and Torri appeared before a revolutionary tribunal in Tehran in an apparent deal to end the crisis. Restrictive measures were then lifted at both embassies.

Gordji's release came two days after pro-Iranian groups in Lebanon freed two Frenchmen who had been held hostage in Beirut. France has denied its release of Gordji was part of a deal with Iran to obtain the hostages' freedom.