San Francisco apartment dwellers are getting the gift of more Internet options this holiday season.

Thanks to a groundbreaking ordinance passed this month by the Board of Supervisors, owners of multiple-occupancy buildings will no longer be able to block their tenants’ access to the Internet providers of their choosing under most circumstances.

The ordinance, which passed unanimously, appears to be the first of its kind enacted by a U.S. city. It applies to both commercial and residential properties.

“From our understanding and all the research we did, this is a first-in-the-nation law that we just passed,” said Supervisor Mark Farrell, who introduced it.

Exclusive deals between multiunit property owners and telecommunications companies have long been banned by a constellation of federal and state regulations. But through a variety of workarounds, building owners in San Francisco and across the country have still been able to wedge themselves between tenants and their preferred providers, for reasons ranging from a reluctance to retrofit the buildings to profit-sharing agreements with telecom companies.

Farrell said the ordinance was born in part out of the “extreme frustration” he heard from Internet service providers who were being blocked from marketing to or accessing customers in large multi-dwelling units.

Farrell also saw it as a way to provide more options to what he estimated to be 100,000 San Francisco residents who don’t have Internet access at home.

“I believe Internet access should be viewed as a fundamental right in today’s world,” Farrell said. “It’s impossible to interact on a daily basis without access to the Internet.”

The ordinance requires that Internet providers pay property owners “reasonable compensation” for access to their buildings, and specifies that landlords can’t deny new providers access to existing wiring within buildings. The whole process is laid out step-by-step with specified deadlines.

That’s welcome news to Kevin Hsiung, a San Francisco resident who was confounded after his property manager told him that the only Internet providers offered to tenants were Comcast and AT&T. Hsiung had been trying to sign up for service with Webpass, a high-speed provider based in San Francisco acquired by Google in June.

“They basically just told me, ‘We only allow (Comcast and AT&T) into the building,’ and that’s as far as I got,” Hsiung said. “Webpass told me they were rejected from the building, but they didn’t tell me why.”

Now that the city’s ordinance has passed, Hsiung said he intends to look for other Internet options — just as soon as his one-year contract with Comcast ends.

“Comcast shares San Francisco’s goal of promoting competition, and we compete daily with numerous providers to offer our services to consumers across the city, including single-family homes and multi-dwelling buildings,” a Comcast spokeswoman said in an email.

Multiunit property owners may want to restrict tenants’ access to different Internet providers for a number of reasons. Some don’t want to risk damaging architecturally or historically significant buildings. In other cases, property owners can enter into revenue-sharing agreements with telecom companies, which provide incentives to landlords that connect tenants with specific carriers. Previously, landlords could flatly deny new providers access to their buildings, since, technically, that’s different from preventing their tenants from signing up with their carrier of choice.

Comcast declined to address whether it enters into revenue-sharing agreements with property owners or landlords in San Francisco.

Dane Jasper, the CEO of Sonic, a Santa Rosa company that installs and provides high-speed fiber optic Internet service, said that at any given time, the company has 30 to 50 San Francisco customers waiting to get hooked up as the company negotiates with building owners.

“And unfortunately in some cases, landlords have been blocking the installation of the service,” said Jasper, whose company works in the Sunset, Richmond and Parkside districts.

The new ordinance, Jasper said, would be particularly helpful when it comes to making the process of choosing a new provider more transparent for all parties involved, as well as “making it clear that consumers should be given the choice of more than just one or two carriers,” he said.

The ordinance initially faced considerable opposition from building owners’ groups, some of which saw it as an erosion of landlords’ rights to do what they please with their own buildings.

The San Francisco Apartment Association, a group that advocates on behalf of rental housing management, balked when the ordinance was introduced in October, and even considered filing a lawsuit.

But over time, many of the group’s concerns were addressed and worked into the final version, said the association’s government affairs manager, Charley Goss.

“We have to credit Supervisor Farrell’s office,” Goss said. “He made some amendments that moved it in a good direction.”

Goss said that he “doesn’t see” his group getting involved as a plaintiff in a suit against the ordinance any longer.

“We’re not super enthusiastic about it, but there were amendments made to address many of our concerns,” he said.

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