OAKLAND, Calif. (AP) _ Buck Helm, the burly longshoreman who survived 90 hours in the rubble of a freeway flattened in the Oct. 17 Bay area earthquake, died Saturday night, hospital officials said.

Perhaps the quake's most famous survivor, Helm, who turned 58 on Nov. 10, died of respiratory failure at 7:30 p.m. PST at Kaiser Permanente Medical Center, said hospital spokesman Ronald Treleven. He said attempts to resuscitate Helm were unsuccessful.

Rescue workers were stunned to find Helm alive in his squashed car in a 1 1/4 -mile collapsed section of Interstate 880, the double-decked Nimitz Freeway, in Oakland four days after the 7.1-magnitude quake struck Northern California.

His condition recently had improved slightly, Treleven said. Helm had been taken off a kidney dialysis machine and doctors had hoped they might soon be able to take him off a respirator that enabled him to breathe.

''We were very surprised. We were very saddened,'' Treleven said.

Helm's death brought the quake's overall death toll to 67 and the Nimitz Freeway toll to 42. The quake injured more than 2,800 people, left more than 14,000 homeless and caused an estimated $7 billion in damage.

The 5-foot-10, 220-pound Helm, whom local radio stations had affectionately dubbed ''Lucky Buck,'' was pulled from the most heavily damaged section of the collapsed freeway.

Rescuers had given up hope of finding more survivors when an engineer inspecting the structure's stability saw Helm wave from inside his small car. A large beam that fell in front of Helm's small car saved it from being flattened.

Helm suffered a fractured skull, three broken ribs, nerve damage to his leg and kidney problems due to dehydration.

Helm was a longshoreman's clerk who worked the docks in Oakland and commuted 250 miles on weekends to visit his family in Weaverville. After his rescue, get-well messages were posted in shop windows, outside the courthouse and on the marquee of a theater in the tiny town.

Helm's former wife, Lorrie Helm, said he seemed to understand what had happened to him and was able to communicate with people around him. She said he had acknowledged hearing the contents of cards and letters from around the world that his family read to him.

''His love for us and our love for him is one of the major things that kept him going,'' Mrs. Helm said at a news conference three days after his rescue.

Helm was unable to talk because of the respirator tube. ''We talk with our eyes, with our hands, and the love we feel for each other,'' Mrs. Helm said.

Helm was transferred from Highland General Hospital to Kaiser Permanente on Nov. 2 because he was a member of the Kaiser health maintenance organization, his wife said at the time. Kaiser initially said Helm was in serious but stable condition, but three weeks ago his family told the hospital not to comment publicly on his recovery.

Telephone calls to Mrs. Helm's home and to the family's lawyer, Bill Choulos, went unanswered Sunday morning.

Helm's family has received dozens of movie offers for the story of Helm's survival but Choulos said none was being seriously considered. Choulos had hired a Beverly Hills public relations firm to handle media and other inquiries.

There was no immediate word of memorial services. Helm is survived by his wife and at least four children.