Maxfield Parrish's Pied Piper had been hanging behind a Palace Hotel bar for over 100 years.
News that the hotel owner planned to auction off the painting caused an uproar. So, on Monday the owner backtracked, announcing that the painting will remain at the hotel. But first, it will be restored.
"It's currently en route to New York City, where it will get a facelift and it should probably take four to six weeks," said Palace Hotel General Manager Christophe Thomas.
Mayor Ed Lee said he personally called the Palace Hotel management to ask that the painting stay in San Francisco. He says it is part of the city's heritage.
The painting, which measures 16 feet long by six feet deep, was selected as one of the city's "legacy bars and restaurants" by the San Francisco Architectural Heritage.
It was painted by Parrish, one of the most noted American painters of the 20th century, in 1909 especially for the Palace Hotel, which reopened that year. The original Palace Hotel was destroyed in the 1906 San Francisco earthquake and fire.
The painting is valued at anywhere between $3 million and $5 million.
(The Associated Press contributed to this report)