Jacques Mesrine, France's public enemy number one, died today just as he always said he knew he would -- in a hail of police bullets. About 50 plainclothes police in several vehicles ambushed him in his car in the working-class neighborhood where he grew up near the Paris flea market.

On the seat beside his body, police said they found two hand grenades, one with the pin half-pulled, and a 9mm Smith & Wesson submachine gun. His woman companion was severely wounded.

Police say they counted 18 bullet holes in his body. Witnesses said they heard just one long, steady burst of automatic weapons fire.

The windshield showed a pattern of bullet holes fired straight down from the opened back of a delivery truck parked directly in front of Mesrine's gray sedan. His body was held in place by his seat belt.

Eyewitnesses said that after Mesrine had been gunned down by four officers who jumped from the back of the truck that blocked the criminal's car, dozens of plainclothesmen emerged from the immediate surroundings and enthusiastically hugged one another like the members of a soccer team after the winning goal.

Maurice Bouvier, chief of French detectives, and widely considered the pipe-smoking, real-life incarnation of Inspecto Maigret, the character created by thriller writer Georges Simenon, told a press conference tognight that it was through an intensive police tail on four potential Mesrine accomplices that police finally caught him.

The police said a contingent of 80 detectives, including six sharpshooters, had been watching Mesrine's hideout since Monday after a tip that the outlaw had returned to Paris and was getting ready to pull another of the high-profile, spectacular jobs with which he had almost singlehandedly created a growing image of police incompetence that was beginning to visibly sap the department's morale.

Mesrine's death ended an 18-month odyssey in which he had thumbed his nose at the institutions of French society ever since a breakout 18 months ago from the maximum security Sante prison that cost the jail's director his job.

Mesrine followed that up with capers like the holdup of the fashionable casino at Deauville, the successful kidnaping of a major industrialist and the attempted kidnaping of the chief judge of the Paris appeals court.

The 42-year-old Mesrine, in the growing tradition of French intellectual adventurers, interplaced his daring criminal stunts with press interviews full of leftist-tinged criticism of French prisons, justice and society. There were suggestions that he was being helped by international terrorist organizations rather than by the traditional underworld milieu. At one point, he was reported to be living almost openly in Algeria.

Mesrine, who was decorated for military courage during the Algerian war, gave up a promising architectural career for a life of crime in Canada, the United States and France. First sentenced to jail, for burglary, in 1962, he committed his first murder in 1967 at the age of 31.

Mesrine's end provided the first good news in weeks for a French government engulfed in mounting political scandals and accusations of incompetence in the budgetary and economic fields.

Interior Minister Christian Bonnet went to the Elysee Palace to give a personal report to President Valery d'Estaing within a half-hour of Mesrine's death this afternoon. Prime Minister Raymond Barre asked Bonnet to thank each of the policemen involved in the Mesrine operation on his behalf and that of the government.

Not since U.S. master criminal John Dillinger was gunned down by authorities during the depression as he was coming out of Chicago movie house has a criminal odyssey so captured the public imagination of a major western country.

Paris radio stations this afternnon constantly interrupted their regular programs for minute-to-minute updates of the case that had been the subject of hundreds of major articles in both the serious and popular press.

Mesrine earned himself a Robin Hood reputation that had made him a darling of French leftist intellectuals. The press repeatedly incurred the anger of feminist groups by focusing on the special attraction he held for women.

Public opinion seemed to turn against him only six weeks ago after his last exploit in which he lured French crime reporter Jacques Tillier to a rendezvous with the promise of an interview and then made him undress and shot him five times. Claiming he had given Tillier, who survived, "a severe lesson," he took gory pictures after each shot and sent them to the press.

Apparently to justify the fact that the police hardly have Mesrine any chance to surrender, Bouvier quoted a nuber of Mesrine statments that he would shoot it out and never let himself be taken alive to return to prison. At the end of the 1977 trail that got him a 20-year sentence in the Sante for armed robbery and attempted murder, Mesrine told his arresting officer, "The next time we meet in the street, the one who shoots first will be right."

In his most notorious interview, with the picture magazine Paris-Match in the summer of 1978, Mesrine threatened Justice Minister Alain Peyrefitte that if he did not greatly improve conditions in the maximum security jails, he would form a Baader-Meinhoff-style gang and unleash more violence than had ever been seen in France.

"i,m a nitroglycerine expert," he said, adding, "I know very well that I,m going to die, tomorrow, in two weeks in eight months or a year if I,m lucky." Serving his interviewer, an attractive woman reporter who later married one of Mesrine's lawyers, a full-course leg of lamb and champagne meal he had prepared himself, Mesrine said:

"I have never robbed the poor . . . I have never raped nor attacked the elderly nor exploited women. If I have married adventure, it is because I love danger. I have broken the laws with pleasure and lived outside of them. I have no remorse and no regrets".

While in jail, Mesrine wrote a book called "The Death Instinct" outlining his criminal career from its start in Canada in 1969, and including the murder there of two forest rangers and others.

French authorities seized the book before many copies could be sold, as well as the hefty movie rights fee paid by actor Jean-Paul Belmondo, who had apparently wanted to play Mesrine in the film.

Mesrine's most successful single job was probably the kidnaping earlier this year of 82-year-old provincial millionaire Henri Lelievre. After holding him for six weeks, Mesrine managed to evade all the elaborate traps police set for him and to excape with the ransom of $1.5 million.

In one of his numerous previous public statements, Mesrine had said, "the day when I get $1.5 million together, I'll retire to South America." It was a promise he apparently was psychologically unable to keep.