A San Francisco woman appears to have made history as the first person to successfully fend off an Ellis Act eviction through a jury trial.

On Thursday, a jury found that Betty Rose Allen would not have to vacate her Noe Valley apartment, where she’s lived for nearly 40 years, after a lengthy and acrimonious legal battle with the building’s owners.

The family that owns Allen’s three-unit building sued in San Francisco Superior Court to have her removed from it in June, just over a year after serving her and her mother, Beatriz Allen, with an Ellis Act eviction notice. Ellis Act evictions, which allow landlords to boot out tenants when they no longer wish to rent out a property, give elderly or disabled tenants a year to find new housing. Beatriz Allen died in April.

Mark Chernev, an attorney for the Hilaly family, which bought Allen’s building in 2014, said the family’s intent from the beginning was to live under the same roof and that it hoped to find an amicable solution for relocating the Allens.

Allen’s attorneys at the Tenderloin Housing Clinic disputed that notion, saying that one of the family members, Tariq Hilaly, routinely harassed the Allens in an effort to force them out, either to lease their rent-controlled unit out at market-rate prices or possibly to turn it into a commercial enterprise.

Before the Ellis Act notice, the Hilalys also tried to remove the Allens from the building through an owner-move-in eviction, where landlords can take over an apartment for themselves or on behalf of family members. Chernev said a frail member of the Hilaly family became ill and needed to stay near family to recuperate, which compelled them to accelerate the Allens’ eviction. The Hilalys backed down from that effort after Betty Rose Allen took her dispute with the family public.

“Every time Betty Rose did something to exercise her rights, something negative would happen,” said Raquel Fox, one of Allen’s attorneys. Fox said that included actions such as failing to give notice before entering Allen’s unit and removing her garbage can.

The jury rejected arguments that the Hilalys didn’t have a bona fide intent to exit the rental business. Instead, Allen’s attorney convinced the jury that the Hilalys had changed the terms of her tenancy when they took over a building garage that Allen was paying for and had the right to use.

Margaret DeMatteo, another attorney for Allen, said that on a rental information questionnaire the Allens filled out once the Hilalys bought the building, Allen mistakenly indicated that parking was not a part of her lease agreement. The Hilalys, Allen’s attorneys argued, took that to mean the garage was theirs to use, which they did for more than a year.

The jury found that discrepancy constituted an improper change of Allen’s tenancy agreement and ruled in her favor on those grounds.

Chernev said that a change-of-tenancy defense “is not a legally recognized defense in an Ellis Act” eviction case and that he expects his clients to appeal the decision.

“They can take that position now, but they lost,” DeMatteo said, adding that she’s confident the verdict would be upheld on appeal.

Dominic Fracassa is a San Francisco Chronicle staff writer. Email: dfracassa@sfchronicle.com Twitter @dominicfracassa