An official French inquiry cleared both the Socialist government and the secret service today of responsibility for the sinking of an environmental-protest ship in New Zealand last month.

The French investigation found, however, that five people named by the New Zealand police as suspects in the July 10 attack against the Greenpeace ship, Rainbow Warrior, were French intelligence agents, although it added that there was no convincing proof of their guilt.

Political analysts here said the 29-page report was unlikely to end the controversy. A Portuguese-born photographer was killed in the explosion, which occurred just before the ship was due to lead a flotilla of protest vessels toward France's nuclear test site in the Pacific.

The report was received with satisfaction by the governing Socialists but denounced as a "whitewash" by the opposition Communists and France's fledgling environmental movement. The Canadian-born president of Greenpeace, David McTaggart, declined immediate comment on the report but said he supported a call by New Zealand Prime Minister David Lange to submit the case to the International Court of Justice at the Hague.

"Lange called the report "incredible and transparent" and hinted that the French ambassador may be expelled. ("You cannot have a form of acceptable association with another country that sets its spies on you and ignores your warrants for arrest for murder," he told a radio interviewer Tuesday, according to The Associated Press.

("The French have a remarkable flair for getting out of New Zealand in a hurry. They've demonstrted that recently. Perhaps the same principle could apply to the diplomat. He said that New Zealand would seek an official apology from France.)

The inquiry, headed by Bernard Tricot, a senior french civil servant with Gaullist connections, said that the government had approved an increase in clandestine surveillance of Greenpeace last March after receiving reports that the ecological group planned more anti-French protests. Two separate teams of French agents were sent to New Zealand in late June with instructions to observe the Greenpeace fleet.

Presenting the conclusions of his 17-day inquiry, Tricot said he was certain that no government decision had been taken to damage the Rainbow Warrior. Taking care not to exclude the possibility that the secret service agents could have sabotaged the Rainbow Warrior without formal authorization, he added that he believed in their innocence.

Asked in a television interview who else could have been responsible for the sabotage, Tricot replied: "I simply don't know."

In his report, Tricot speculated that the Greenpeace ship could have been sunk by isolated political fanatics or by the secret services of another country with the aim of embarrassing France and jeopardizing its nuclear program. He presented no evidence for either theory.

Although the thrust of the report was to absolve the French government of responsibility for the Rainbow Warrior's sinking, certain details could be used to support allegations of some kind of French involvement. These included an apparent ambiguity in the government's instructions for dealing with Greenpeace to the General Directorate for External Security (DGSE), the French equivalent of the Central Intelligence Agency.

Tricot, who served as a senior aide to Gen. Charles de Gaulle in the early '60s when France began its nuclear testing program, described the ambiguity as "below what I would call the danger zone" in the conclusion of his report.

The investigation showed that a note dated March 1 from the director of the French nuclear testing center called for an "intensification of information-gathering" against Greenpeace in order to "foresee and anticipate" ("prevoir et anticiper") the movement's activities. In French, Tricot noted, the verb "anticiper" carries supplementary meanings of "prevent" or "forestall."

The Tricot report appeared to draw heavily on testimony by Defense Minister Charles Hernu, who is politically responsible for the running of the DGSE, senior DGSE officials and three of the six secret agents involved in the Greenpeace operation. Tricot said the possibility that the DGSE officers were telling lies appeared to be "excluded" by their "training" and "character."

In a radio interview tonight, Tricot conceded that it was "not inconceivable" that senior DGSE officials "hid a part of the truth from me . . . in order to protect the service."

"I don't believe that to be the case, but I cannot exclude it," he said.

Allegations of French secret service involvement in the Rainbow Warrior's sinking have been fanned by the arrest of two French intelligence agents in New Zealand on charges of arson and murder. Most French newspapers, including the normally sober Le Monde, have concluded that the boat was sunk on the orders of the DGSE.

In his report, Tricot named the two agents under arrest in New Zealand as Maj. Alain Mafart, 34, and Capt. Dominique Prieur, 36. The two agents had posed as a recently married Swiss couple and were equipped with forged Swiss passports in the name of "Turenge."

They are due to appear in a New Zealand court Nov. 4 for a pretrial hearing, during which police will outline the evidence against them. They were arrested after returning a camper seen on a beach near the port of Auckland at about the time of the Rainbow Warrior explosion.

Tricot said that a second team of DGSE agents had been aboard the yacht Ouvea, which was moored in the small harbor of Whangarei, north of Auckland, in the days prior to the explosion. The agents, all trained frogmen, were named as Master Sgt. Roland Verge and sergeants Andries and Bartelo.

The three members of the Ouvea crew, also sought by the New Zealand police for murder, have been in hiding in France since the scandal broke. At Tricot's suggestion, they presented themselves to judicial authorities today, but were immediately released on the grounds that New Zealand cannot extradite French citizens.

Tricot's report described as "improbable" allegations that the two underwater mines that blew up the Rainbow Warrior had been planted by either member of the "Turenge" team. It said that Prieur suffered from a bad back, while Mafart had ceased professional diving in 1983.

The report said that the alternative hypothesis -- that the "Turenges" merely supervised a sabotage operation carried out by the crew of the Ouvea -- appeared superficially "less improbable." But it listed arguments against it, including the fact that there was only a two-day overlap in the stays of the Ouvea and Rainbow Warrior in New Zealand and the carefree attitude shown by the French agents.

Tricot reported that, besides making no attempt to hide their traces while in New Zealand, "our compatriots aboard the Ouvea displayed a marked attention to the female part of the population." He added in parenthesis that "this was only of course true as far as the bachelors were concerned."

The mission of the Ouvea's crew was described as observing the Greenpeace fleet off New Zealand and learning to handle small boats in the South Pacific.

The inquiry also cleared a DGSE official identified as "Dubast," who had been assigned to keep an eye on the Ouvea.