Apartment 10W at 45 East 66th Street went up for sale for $6.5 million in July. The prewar apartment includes “an abundance of sunshine, high ceilings, and beautiful hardwood floors,” according to the listing. The layout is “thoughtful and inviting.” The dining room is “ideal for a tranquil breakfast or cozy dinner.” Oh, and “pets are welcome” in this co-op building.

The seller, Rudolph W. Giuliani, could certainly use the cash.

His lawyer, Adam Katz, filed an article about the apartment being listed for sale as an exhibit to show that Mr. Giuliani, 79, “was close to broke.”

That was earlier this month at a court hearing where lawyers for Smartmatic, an election technology company that sued Mr. Giuliani and Fox News in 2021 over false claims of election fraud, argued that Mr. Giuliani was using his financial state as an excuse for not sharing discovery documents.

There “are a lot of bills that he’s not paying, from a $57,000 phone bill to significantly more,” Mr. Katz said at the hearing. “I think that this is very humbling for Mr. Giuliani.”

It’s a precipitous fall for “America’s Mayor” — the lawsuit is among several legal matters entangling Mr. Giuliani. Last week, he surrendered at an Atlanta jail for the racketeering case against former President Donald J. Trump. Mr. Giuliani has been identified as a co-conspirator.

The controversies have left stains not just on Mr. Giuliani’s reputation, but on the apartment’s as well. It was raided by the F.B.I. in 2021, overshadowing its walking distance to Nobu and Bergdorf Goodman.

Years ago, “it was a very positive thing” to prospective buyers that Mr. Giuliani lived there, said Dolly Lenz, a luxury real estate agent, who has had multiple listings in the co-op.

“It was like, it’s America’s mayor, he chose this building — all very good things ascribed to him living in the same building,” she said. But today, Ms. Lenz said she “would suspect it would be wildly different.”

The Sotheby’s broker currently listing Mr. Giuliani’s apartment is Serena Boardman who New York magazine once called the “broker to the fallen stars” when she won the task of marketing a different disreputable owner’s property — Bernie Madoff’s Manhattan penthouse. She did not respond to requests for comment. Mr. Katz also did not respond.

Judith Giuliani, Mr. Giuliani’s ex-wife, recalled the apartment’s glory days, which coincided with Mr. Giuliani’s peak as a national household name in the wake of 9/11.

By 2002, his mayoral term had ended, and he embarked on his apartment search on the Upper East Side while staying at a hotel, the New York Post reported at the time.

He needed a home that matched his heft, and he wouldn’t settle — Ms. Giuliani said that he wanted a top-floor apartment.

After some negotiating, they snagged the 66th Street co-op apartment for $4.77 million.

“He never even saw the apartment until we had already decided to buy it,” she said, adding that the interior design and decoration was done by her. “I found it, I decorated it, I made it his home.”

There, she hosted many luncheons, holidays and charity events — but it was primarily about hosting and entertaining friends and family, not work, Ms. Giuliani said.

“It was home for us,” said Ms. Giuliani, 68, who was married to Mr. Giuliani for 15 years. “He was my husband, and he loved coming home,” she said. “It was a place where he went for it to be a respite.”

In the paneled library room, Ms. Giuliani installed a special humidifying system and plasma TV for Mr. Giuliani, “where he could smoke cigars and relax and watch his Yankee games.”

One of the main appeals of the apartment was that it was “built for entertaining,” Ms. Giuliani said. “The dining room seats 40 people,” she said. “I loved giving my themed luncheons — make an Easter egg for Easter, Valentine’s — I’m known for that, I still do that.” The Giulianis’ guest lists were just as impressive; the Kissingers, Vera Wang and George Pataki, among others, attended the events, she said.

Difficult times were spent there too. “Rudy had prostate cancer, when we first met, which we also lived through in that apartment,” Ms. Giuliani said.

Over the years, Mr. Giuliani’s real estate portfolio also included a Hamptons home which he bought for $3.2 million in 2004, a private locker at the storied Nat Sherman smoking lounge in Midtown Manhattan and two Palm Beach condos — “I’m just going to play some golf and relax,” he told the New York Daily News while in Florida in 2009.

But the Upper East Side apartment has remained at the center of his assets. The gothic-style apartment complex was built between 1906 and 1908, and it was designated as a landmark in 1977.

When architects applied to build a new penthouse addition at the top of the building, Mr. Giuliani sought to block the construction. In 2014, Curbed reported that Brian Morgenstern, a lawyer for Mr. Giuliani, said that a “penthouse on top of a penthouse on top of a penthouse” would be too much.

The concern, on Mr. Giuliani’s part, was perhaps because at the time, his apartment was on the top floor, and he didn’t want to lose his own penthouse status.

“At the time that we bought it, it was a penthouse. It was extremely important to Rudy that he lived in a penthouse,” she said.

The new addition was approved by the Landmarks Preservation Commission.

Mr. Giuliani was no longer at the top.

His marriage would soon wane.

By 2018, Ms. Giuliani filed for divorce. Mr. Giuliani’s dealings with Mr. Trump were well underway and public opinion started to turn against him. “I’m sad to know that the hero of 9/11 has become a liar,” Ms. Giuliani told The Times in 2019, of the legal battle to get from the divorce what she felt she was owed.

Though she had decorated the apartment and had fond memories of her parties, “I wanted to move on,” said Ms. Giuliani, who is represented by the lawyer Dror Bikel. “He was, after all, the Mayor of the City of New York, at one point a very well respected one. So, it seemed logical that he would have that apartment.”

But it’s “no longer a home,” Ms. Giuliani said. His decision to film in the library for a podcast series in 2020 “gobsmacked me.” And then came the search by the F.B.I., as part of a criminal investigation into his Ukraine dealings as Mr. Trump’s personal lawyer.

“No matter how things ended up, there were many, many, many happy memories in that apartment,” said Ms. Giuliani. “And I wish the next person well, and I wish Rudy well.”

Alain Delaquérière contributed research.