When doctors said Beatriz Allen might only have a few weeks left to live, death was not the biggest threat looming over her family. Her landlords had set a deadline of 9 May for her eviction – right around the time that doctors predicted she might die.

The eviction battle gave the 81-year-old San Francisco woman nightmares, and took a toll on her waning health, according to her family. And on 30 April, Allen went to sleep and never woke up.

“It was scary for her,” said Betty Rose Allen, Beatriz’s daughter, seated inside the apartment where she has lived with her mother since 1978. “Living with mama, and watching them push and push, and allowing that fear to keep increasing … it felt like they were killing her.”

The eviction of the Allens by a Silicon Valley CEO and his family is the latest case of displacement and death in the California city, where a booming tech economy has contributed to rising income inequality and one of the country’s worst housing crises.

Tariq Hilaly, the CEO of a healthcare tech startup called Lumity, bought the property along with his wife and parents in 2014. The landlords’ attorney told the Guardian that the owners had made every effort to resolve the dispute without litigation, and had worked to assist the family with relocation. He further asserted that the owners had been patient and accommodating, even though Tariq’s parents, who are in their 70s, have a right to occupy the property and are eager to move into the Allens’ apartment to be close to family.

But Betty Rose and her supporters said it was unethical for the landlords to evict Beatriz in her final year of life, and that the recent evictions of seniors in rent-controlled homes were a form of abuse that could increase as housing prices continued to soar in San Francisco and the surrounding region.

In March, a 100-year-old tenant, Iris Canada, died in San Francisco after losing her protracted eviction battle with owners, and nearby Carl Jensen, 93, also died amid a fight over the fate of his property.

“Mom is No 3. She is the third person to be killed and die for this,” said Betty Rose, 58, who is still fighting to stay in her home, which is located on the same block where she grew up in the city’s Noe Valley neighborhood.

Wealth has become so immense in San Francisco that the federal government recently stated that a household making $105,350 per year could be considered “low-income”. By many measures, the city has the priciest real estate in the US.

Beatriz grew up in El Salvador, and her family was twice exiled before she eventually relocated to the US, her daughter said. The two worked for the San Francisco school district until Beatriz suffered multiple strokes starting in 2002. For 15 years, Betty Rose cared for her mother, who was severely anemic and had from vascular dementia and chronic kidney disease.

Beatriz Allen, who had lived in her apartment since 1978. Photograph: Courtesy of family

Their new landlords – who also purchased the property next door and moved in – first filed an eviction notice in March 2016, saying that the owners’ family intended to occupy the Allens’ unit, records show. They were given 60 days to leave.

After the tenants’ attorneys fought back, the landlords eventually said Beatriz and her daughter could stay for one year, which in some cases is required by law for seniors and tenants with disabilities.

The eviction falls under the Ellis Act, a controversial state law that allows certain property owners to remove longtime tenants from units with rent control. In such a hot real estate market with a major housing shortage, there are clear financial incentives to evict elderly tenants who have maintained low rental rates for decades.

As the 2017 eviction deadline approached and Beatriz’s health worsened, the family wanted assurances that the mother would not be forced out in the final days of her life.

On 28 April, Mark Chernev, an attorney for the Hilalys, told Beatriz’s lawyers that the owners would agree to let the 81-year-old woman remain in her home until her death – but only if Betty Rose agreed that she would voluntarily move out after her mother died.

“The owners remain hopeful your clients would reconsider avoiding litigation entirely by simply agreeing that Betty Rose will voluntarily surrender possession,” wrote Chernev, who also represented the landlords who evicted Iris Canada, the 100-year-old woman.

Betty Rose said it was hard to focus on the eviction and the lawyers when she knew she was spending her final weeks with her mother. But she was also not ready to give up her apartment of nearly 40 years.

“She wanted to fight for her home,” said her attorney Raquel Fox, who argued that the landlords should have halted the eviction efforts once doctors said Beatriz only had a few months or weeks to live. “Her health was just deteriorating.”

Two days after Chernev’s letter, Beatriz died.

On a recent afternoon, Betty Rose broke down crying recounting how her mother kept asking if they could invite the landlords over for dinner and try to convince them to let her stay: “What was breaking her heart was that she just didn’t understand why our landlord had lawyers against her. We were really good tenants.”

Chernev told the Guardian that the owners had offered a $100,000 relocation payment and had been willing to give Betty Rose a “generous grieving period” to stay after her mother’s death if she had agreed to move. The tenants’ lawyer, however, said they were not offered the settlement payment.

Chernev criticized the tenants’ attorney for continuing to fight the case, saying it was a losing battle: “The owners are going to get possession.” He also emphasized that Tariq’s parents, who are currently living out of state, are elderly: “They just want to live with their family, which they’ve been wanting to do for a year and a half now.”

Tariq Hilaly and his parents did not respond to a request for comment.

Leslie Dreyer, an anti-eviction organizer with the Housing Rights Committee, noted that low-income tenants and seniors often have nowhere else to go after being evicted from a longtime home in San Francisco.

“How many more elders do we have to lose before our representatives actually take initiative to protect the tenants that are most in need?” Dreyer said.

Asked what her backup plan would be if she had to leave her home, Betty Rose paused and sighed. “I don’t have one.”