France and Italy made secret deals with Libya during the 1970s to spare their citizens from attack in exchange for giving Libyan-sponsored terrorists the freedom to travel through Europe, U.S. officials said yesterday.

The deals, which have since collapsed, were discovered by Reagan administration officials last year when they attempted to bring the Europeans into a united effort to pressure Libyan leader Muammar Qaddafi, one aide said.

"The French had a deal with Libya and a deal with the PLO [Palestine Liberation Organization]," a State Department official said. "Italy had its own deals. The French used to think that between the PLO and the Libyans they had it all sewed up."

As a result, he said, "the French would look at a guy, a known terrorist, as he went through their airports and not lift a finger."

But, officials said, the secret pacts disintegrated after Libyan-based terrorists bombed restaurants in Paris and attacked travelers at the Rome and Vienna airports last December.

"There has been a feeling throughout western Europe that you can have an accommodation so you won't have terrorism in Country X, and in exchange terrorists could come and go from Country X freely," Robert B. Oakley, director of the State Department's counterterrorism office, said in an interview with National Public Radio.

"They acknowledge in private that they've had such arrangements blow up in their faces, figuratively and literally, in airports and cafes," he said. "You have a gentleman's agreement with a terrorist, and unfortunately the terrorists turn out not to be gentlemen."

A spokesman for Italy's embassy in Washington, Massimo Baistrocchi, denied that his government had ever entered the kind of pact described by the U.S. officials but said the Italian intelligence agencies did establish a cooperative relationship with Qaddafi.

"We never dealt with terrorists. We never had any agreement," Baistrocchi said. "We had a crazy, terrible problem of terrorism within Italy. It is not possible that we would be fighting terrorism on one side and dealing with it on another."

An official at France's embassy who asked not to be identified said, "If anything like that was done, it was done some time ago, and secretly. We wouldn't have any comment on it."

The U.S. officials who described the arrangements said that they were not certain when the deals were struck but that they appeared to be products of the wave of European terrorism in the mid-1970s, when European police forces were hard-pressed to deal with the violence in their own countries.

At the time, working out "nonaggression pacts" with the Libyans and the PLO may have appeared sensible because it seemed to reduce the immediate threat of terrorism, they said.

Greece and West Germany also maintained contacts on terrorism with Libya and the PLO, they said, although it was not clear whether they negotiated similar deals.