Updated

A bunch of rotting doors to the rooms of an old New York City hotel recently fetched a total of more than $400,000 at an auction -- because they were saved from a trash heap by a sharp-eyed homeless man.

The top seller? The door to the Chelsea Hotel room where Bob Dylan is believed to have stayed. It sold for $125,000, Agence France-Presse reported.

bob

Bob Dylan is shown at an awards event in Los Angeles, Feb. 6, 2015. A door from a room in which he stayed at New York City's Chelsea Hotel recently sold for $125,000. (Associated Press)

A door linked to singers Janis Joplin and Leonard Cohen sold for $106,250, while doors connected with Jimi Hendrix and Madonna sold for $16,250 apiece, the report said.

The Chelsea, on 23rd Street in New York City, opened in 1884 and has long been a favorite among artists, writers and musicians.

Other famous guests and residents have reportedly included Mark Twain, Andy Warhol, Arthur C. Clarke, Humphrey Bogart, Janis Joplin and many others.

Perhaps most notoriously, it was the site where Nancy Spungen, the girlfriend of Sex Pistols band member Sid Vicious, was found dead in 1978. The punk rocker was arrested and charged with second-degree murder, but died of a drug overdose before the trial could start.

PD*2269052

Sid Vicious of the Sex Pistols was charged in the death of his girlfriend at the Chelsea Hotel in 1978, but died of an overdose before the trial.

In 2011, the hotel closed for extensive renovations, AFP reported. The next year, former resident Jim Georgious – who was evicted for non-payment of rent in 2011 – recovered more than 50 doors that were being discarded in the trash.

Later, he managed to match 22 of the doors to specific rooms where specific celebrities had stayed, according to AFP.

"For me they were history and beauty and connected to my heart,” Georgious told the New York Times. “They're precious because there are so many people who’ve been through them.”

Six years after the doors were rescued, renovation work on the hotel continues, the BBC reported.

And Guernsey’s auction house, which handled the sales, is still tabulating the money, the AFP reported.

Georgiou has pledged half of his take from the auction to City Harvest, a nonprofit that feeds the needy, the report said.