The bathroom is one of a pair of compact buildings tucked behind the New York Public Library on Fifth Avenue; the other has been converted into a park office and storage area. Designed as a public comfort station as part of the library, which opened in 1911, the bathroom was closed in later decades as the park descended into a blighted eyesore, a place best avoided that was overrun with drug dealers and criminals. Dust and pieces of plasterboard covered the bathroom floor.

“It was a total wreck,” recalled Dan Biederman, the president of the Bryant Park Corporation, a nonprofit that manages the park.

In rebuilding the bathroom, Mr. Biederman said, his inspiration was Brooke Astor, the grande dame of New York society. After all, she was indirectly responsible for saving it: Mr. Biederman said he had been told that in 1979, Mrs. Astor, then 77 and a member of the library’s board of trustees, was on her way into the library for a meeting when she said a “hooligan” approached her on the front terrace and tried to sell her drugs. She complained to her friend David Rockefeller that the area needed to be cleaned up. Mr. Rockefeller helped secure the financial support to make it happen.

“Mrs. Astor was in my mind,” said Mr. Biederman, who envisioned the bathroom as a powder room in a country estate. “Anybody from homeless people to Mrs. Astor could use it.”

The upkeep of the bathroom runs to $271,000 annually, which includes $27,000 for 14,040 industrial-size rolls of single-ply toilet paper and $14,160 for flower deliveries. The bathroom attendants earn between $25,000 and $30,000 a year. The city-owned park is supported entirely through private revenue from a variety of sources, including corporate sponsorships.