NEW YORK — A woman was trapped for three days in the elevator of a Manhattan town house, where she worked, while the house’s owners spent a weekend away, officials said.

The woman, Marites Fortaliza, 53, of Queens, was rescued Monday morning only after a person attempting to deliver something to the building contacted the home’s owners. The owners sent a family member, who saw that Fortaliza was trapped inside the broken lift and called 911, police and fire department officials said.

After she was rescued Monday, Fortaliza appeared to be in good condition, but was taken to a hospital for treatment, James Long, a Fire Department spokesman, said. She had been alone in the elevator since Friday evening, he added.

Firefighters reported to the home at 48 E. 65th St., a five-story building on the Upper East Side, just after 10 a.m. Monday, Long said. The firefighters forced open the doors of the elevator, which was stuck between the house’s second and third floors.

Hugo Martinez, 50, who works next door, said Fortaliza appeared conscious and calm when firefighters removed her from the building on a stretcher.

The homeowners, Warren and Harriet Stephens, said in a statement released Monday that Fortaliza has worked for them for 18 years. They also said a member of their family accompanied Fortaliza to the hospital, where she was “doing well.”

The elevator had most recently been inspected in July and no violations were filed, according to city records.

The city Department of Buildings said it was investigating the incident, though an inspector, Devon Simmons, who knocked on the front door Monday was not let into the building.

Simmons said he would need to do tests to determine what led to the elevator’s malfunction. Until he was given access to the building, he said, the homeowners would be flagged with a violation. The Department of Buildings issued one later that day, a spokeswoman said.

Simmons did not know whether the elevator had a phone or emergency button in it. According to the Department of Buildings, buildings that do not have people continuously monitoring them are required to have buttons or phones in their elevators that can signal a service capable of taking action in an emergency.

“The cause of this unfortunate incident is being investigated,” the Stephens family said in its statement, “and appropriate measures will be taken to ensure that something like this never happens again.”

After Simmons’ visit, a mechanic for Schindler Elevator, an elevator manufacturer, walked out of the town house and said his company was working to determine the source of the problem.

The Stephenses purchased their town house, near Madison Avenue and down the block from the fine-dining stalwart Daniel, in 1999. The couple spent nearly $8 million on the home, The New York Times reported later that year. The elevator was installed before they purchased the house, which was built in 1920, property records show.

Warren Stephens, a billionaire investor originally from Arkansas, is chairman and chief executive of the investment firm Stephens Inc., which is based in Little Rock, Arkansas, but also has an office in New York. In 2018, Forbes, which ranked him 302nd on its list of the 400 wealthiest Americans, estimated his net worth at $2.7 billion.

In 1999, The Times described him as “understated,” and said he and his wife “zealously guarded” their family’s privacy.

The incident was not the first time in recent memory that someone in New York City had been trapped in an elevator for an extended period. In 2005, a deliveryman for a Chinese restaurant was stuck in an elevator in the Bronx for roughly 81 hours.

In 1999, a man who was returning to his desk from a cigarette break was stuck in an elevator in a Midtown office building for 40 hours. He was freed after a building employee saw him on a security camera. The New Yorker later published video showing how he spent the time.

This article originally appeared in The New York Times.