The apartment has spacious windows, a sleek kitchen and expansive views of Manhattan. It boasts a prime location close to Central Park and Rockefeller Centre and promises all the excitement of a luxury apartment in Midtown Manhattan.

And it was available for a substantial, but not completely unheard-of, price of about $300 to $450 a night through the home rental website Airbnb. Renters would just need to go through an extensive Secret Service screening downstairs.

The rental was inside Trump Tower.

The listing was taken down last week hours after The New York Times contacted Airbnb for comment. But the apartment had been available to rent since at least last September – long after the building that helped make Trump famous was turned into an operation centre for his campaign. And it remained available, and as its Airbnb listing noted, quite popular, for about a month and a half after Trump’s inauguration.

More than 500 people had viewed the listing in the week before it was removed, and the apartment had been booked for much of March, April and May.

The listing represented an extraordinary opportunity in American history, one facilitated by both modern technology and a president with a large real estate portfolio: a chance for travellers to book a room in a building housing the president’s family – one of the most secure buildings in New York City, if not the world – with nothing more than the click of a mouse.

“It was surreal to be honest,” said Mike Lamb, a software engineer from England who stayed there with his wife in December. “It was certainly an interesting experience.”

Three guests who stayed at the apartment described it in interviews as an uncommonly nice place to crash. One, who stayed there before the election, remembered encountering a delay when he returned about the same time as a fleet of vehicles that most likely carried Trump. Two guests spoke about the presence of protesters outside.

“You can hear them shouting from high up in the building,” Lamb said. “I remember sitting in bed thinking, ‘I can hear them, I wonder if he can hear them.'”

Lamb said that he caught a glimpse one day of Mike Pence, then the vice president-elect, heading into Trump Tower from his motorcade.

The apartment was available through the website’s “instant book” feature, which allows anyone with an Airbnb account to book a stay without so much as a message to the host. A New York Times reporter reserved it this way last month for a weekend stay in April.

“Welcome!! Looking forward to meeting you!” the host, Lena Yelagina, wrote back.

She said that she’d meet the guest downstairs and show him around. “Can you please do not tell building staff that it’s Airbnb but that you are rather visiting me,” she wrote. “I will really appreciate it!”

But, two days later, Yelagina wrote again to say that she had discovered that the guest was a journalist and that she did not want her apartment to be used to learn anything about Trump or to be featured in an article.

“I apologise for this request but I have to make sure that we have a precise agreement and will not have any problems,” she wrote.

After the reporter informed her that he planned to write an article, she cancelled the reservation and did not answer any questions. Public records indicate that Yelagina has owned the apartment since 1998 and is listed as an owner of another condominium on the Upper West Side.

How the listing was able to float under the radar in such a high-profile building remains a mystery. It is illegal under state law to advertise and rent most apartments in New York for fewer than 30 days when the host is not present. The Trump Tower listing advertised the entire apartment, and said that it could be rented for as few as three nights.

Nor was it clear whether the Secret Service knew about the listing.

“We don’t comment on our protective operations,” a spokeswoman for the agency, Catherine Milhoan, said.

The listing does not explicitly advertise that the apartment is in Trump Tower, and Airbnb does not disclose addresses until a stay is reserved. Two guests said they had booked the apartment only to be surprised by the address they received in return: 721 Fifth Avenue.

“The host sent me the address, and then I called her and said, ‘I can’t find it, I only see the Trump Tower,'” said Nico Voigtlander, an associate professor at the University of California, Los Angeles who stayed there in November, just before the election. “She said, ‘It’s in the Trump Tower.'”

But those with keen eyes may have been able to pick it out. The listing boasted that the apartment was in “the most secure and unique building.”

Photos on the listing show the building’s jet black exterior and jagged cuts. “Politically neutral please,” the listing said. “It is a specific building, so please – political opinions cannot be shown,” it noted, suggesting that renters not engage in any political displays inside the building.

The apartment attracted rave reviews, getting five out of five stars in Airbnb’s rating system, in which guests assess the accuracy of the rental listing, their communication with the host and the home’s cleanliness, location, value and check-in procedure.

One reviewer, a student from Mexico who stayed there in February, extolled the apartment’s great views and location. He wrote that the only inconvenience was the Secret Service check, but “once you go through it the first time, the Secret Service is something you won’t notice anymore.”

Both he and Lamb compared the security procedure to the airport. Lamb said it included scans with a metal detector and another “X-ray”-type machine.

In a telephone interview, the student, who requested that his name not be used because he did not want to attract attention, said that he was able to check in without the host being there. She had left instructions and a key on the ground floor. He said that he and his boyfriend handed over their identification to Secret Service agents and told them they were staying there.

“They didn’t ask any more questions,” he said.

Airbnb said through a spokesman that it had never been contacted by any law enforcement agency about the listing.

The company, which has more than 3 million listings around the world, said it believed this was the first time a home in a building occupied by a head of state was available for rent on its site.

The spokesman, Nick Papas, said the company was looking into the matter. “This is obviously a unique situation, so we’ve removed this listing from our platform.”

The apartment’s continued availability on Airbnb before, during and after the election raises questions about how such a listing was permitted given the heavy security inside and outside Trump Tower.

Mark Camillo, who worked three stints at the White House during a 21-year career with the Secret Service, said that it wasn’t the job of security to determine who is or is not allowed into a building – only to screen them for potential threats.

“This is the challenge in a free society,” he said. “If we were in countries that were much more heavy-handed, this would be a non-story. And every phone in the building would be tapped.”

Airbnb has been challenged by the issue of regulating illegal listings on its site, engaging in a contentious battle with New York City officials last year.

The Mayor’s Office of Special Enforcement, which is in charge of enforcing local and state laws, said it would investigate the Trump Tower listing. A spokeswoman for the Trump Organisation, which runs the building, said that under condominium rules, listing the units on Airbnb is not permitted.

This story was first published in the New York Times.