Sid Vicious, the British punk rock star accused of murdering his girlfriend last October, died yesterday in New York of an apparent heroin overdose only hours after being released on bail from jail.

The nude body of the 21-year-old Vicious, along with a syringe, a spoon and what police said was "probably heroin residue," was found by his mother and a friend, Michelle Robinson, in a bedroom of Robinson's Greenwich Village apartment about 12:30 p.m. Police first called the death a suicide, but after an autopsy ruled the death accidental. "He had taken a shot of whatever he shoots, had lost the tolerance for it, and he died," said New York medical examiner Michael Baden.

Vicious was arrested Oct. 12 after the body of his girlfriend, Nancy Spungen, was found in the bathroom of their Chelsea Hotel suite. Spungen had been stabbed in the stomach with a five-inch hunting knife. Vicious was released on bail Nov. 7 in the custody of his mother, then arrested again in December after allegedly striking Todd Smith, brother of punk star Patti Smith, with a broken beer mug.

Vicious was freed Thursday after posting $40,000 bond on the murder charge and an additional $10,000 bond on the assault charge.

At a party in the Robinson apartment Thursday night to celebrate his release Vicious, a long-time heroin addict on methadone treatment, reportedly gave himself an injection of heroin about midnight and 45 minutes later suffered a seizure. He recovered, however, and appeared to be "jovial and happy" as his friends departed, police said.

when the body was found, Vicious was lying face-up. Police estimate death came sometime after 2 a.m. An autopsy has been ordered.

Vicious, born John Simon Ritchie, played bass for the defunct Sex Pistols, the British group that epitomized the most sensational aspects of punk music. Their first single, "Anarchy in the U.K.," released in late 1976, set off an explosion of publicity over the obscene language and onstage antics of the punk rockers.

Vicious was among the originators of the punk fashion of piercing the cheeks and lips with safety pins (although according to some accounts, he only faked his pins). Along with Pistols lead singer Johnny Rotten, Vicious created a vogue for spitting and even vomiting on stage.

By the time the Sex Pistols toured the United States in 1978, they were being touted by their supporters as the crest of the New Wave, harbingers of a violent revolution that would sweep away the "dead" music industry. A cover story in Rolling Stone magazine described the dancing that accompanied their appearances in England -- "Those with partners (usually of the same sex) grasp each other at the neck or shoulders and act like they are strangling each other." Along with their chopped-off hair and abusive language, violence -- and pseudo-violence -- became faddish.

"One night nobody was payin' any attention to me, so I thought I'd commit suicide," Vicious said in the same article. "So I went in the bathroom broke a glass and slashed my chest with it. It's a really good way to get attention. I'm going to do it again -- particularly since it doesn't work. They all said I didn't cut myself enough to be realistic and ignored me." He laughed, then added "You better not make a fool of me in this article."

Vicious, described by his manager as "an incredible romantic," had been transformed by the publicity which blazed around the Sex Pistols. At about the time he met Spungen -- a topless dancer from Philadelphia's wealthy Main Line and an admitted longtime heroin addict -- Vicious became a constant heavy user of heroin. He turned into a maniac on stage. Hit in the face by a broken bottle during a concert in Dallas, he smeared the blood all over his body and continued to play furiously.

After the disappointing U.S. tour fizzled, Vicious and Spungen moved to New York, holing up in the Chelsea Hotel in late August. During the day they haunted the methadone clinic, and at night Vicious tried to turn his celebrity into a career. His behavior reportedly became erratic, self-destructive: he repeatedly picked fights at the clinic and autopsy reports of Spungen's "old and fresh bruises" suggest he beat her.

On Oct. 12, Spungen's body was found wedged under the sink in the bathroom. Vicious said he was unable to recall anything about the morning. Police arrested Vicious that afternoon and charged him with the murder.

Friends called it a bungled suicide pact. And on Oct. 22, Vicious gashed his arm with a broken light bulb and a razor blade, screaming, "I want to join Nancy -- I didn't keep my part of the bargain!"

He was taken to Bellevue Hospital and kept under surveillance for two weeks before being released into his mother's custody.

Spungen's death ironically provided the publicity Vicious had been seeking for his career. Anthony Burgess published an essay in a London newspaper entitled, "Why Punks Had to End in Evil." Supporters called Vicious and Spungen the Romeo and Juliet of punk rock. The New YorkPost headlined, "Vicious: He Finally Lived Up to His Name."

Vicious reportedly gave police conflicting stories -- first denying, then admitting the killing. His attorney, James Merberg, an associate of F. Lee Bailey, said yesterday he had planned to prove that the statement to police was made under duress.

Merberg expressed surprise that Vicious would have chanced a heroin injection. "He left jail absolutely perfect, completely detoxified. It's really sad. He was just a 21-year-old kid, full of good and bad."