Five men pleaded guilty here today to 819 counts of robbery, attempted murder, rape, sodomy, sexual abuse, burglary and criminal possession of guns and knives in connection with incidents involving more than 100 victims in two diners and a private house in Nassau County in May.

The five, ranging from 19 to 23, had been implicated in what the local district attorney's office had called "one of the most offensive crimes in our history": rape and robbery at a Long Island diner involving 80 persons.

During the crime -- which was preceded by a robbery in Brooklyn and a rape and robbery in Plainview -- patrons at the Sea Crest diner were forced to strip and were robbed of money and jewelry. The five heavily armed gunmen also shot two men, and humiliated and abused their victims, forcing some to simulate sexual acts and pistol-whipping one man.

The victims later said that one of their assailants was laughing throughout. Another attacker was quoted as giving the only explanation a spokesman for the district attorney's office ever heard for the crime: "It's my party."

This morning, in Nassau County Court, the five defendants pleaded guilty to 819 counts, the sentences for which, if served consecutively, would mean 4,000 years in prison for each defendant. They are to be sentenced Dec. 7.

County Judge Raymond Harrington said he would sentence the five to the maximum terms possible. Under New York laws limiting the severity of sentences in multiple crimes, however, that can be no more than 30 years in prison. Harrington said the case involved "the most infamous crimes ever committed in Nassau County."

Ed Grilli, public information officer for the prosecutor's office, said, "Despite the number of victims, there's a cap on the amount of time they can spend in prison in New York state. After the first and second crimes, they're all free rides, so to speak. That's horrendous."

According to police, the five defendants, three of whom had arrest records, arrived at the Sea Crest Diner about 1 a.m., May 29.

They drew guns and forced 73 patrons to strip and lie on the floor. Several couples in the restaurant were forced at gunpoint to engage in sex for the amusement of the robbers, authorities said.

One woman was raped and several others were sexually abused. Two men were shot in the buttocks for failing to respond quickly enough to orders from the gunmen, authorities said.

Three of the men were arrested the next day, and two others gave themselves up within the week. At the police lineup in early June, according to The New York Daily News, many victims wept.

Today, the five came to court, pleading guilty after an unsuccessful attempt by their attorneys to suppress confessions. The confessions, defense attorneys argued, had been illegally obtained.

"We were alleging that the Brooklyn police who originally arrested the defendants made some promise of leniency," said Jerry Carter, who represented one of the five defendants.

Harrington refused to suppress the confessions.

Later, Carter said, "My client freely admitted their involvement, and it was his view -- and that of the others -- that the interest of justice would be served if the victims were spared the trauma of testifying."

Four of the defendants, Robert Samuels, 19, James Henry Martin, 21, Michael Williams, 22, and Bruce Garrison, 22, were involved in all three robberies, authorities said. Williams' brother, Robert, 20, did not participate in the Jericho holdup that preceded the incident in the diner, authorities said.