Regional Measure 3, which would raise tolls on the Bay Area’s latticework of state-owned bridges by $3 to fund $4.5 billion in transportation improvements, was holding onto a lead early Wednesday with about half of the ballots counted.

The measure, on the ballot in all nine Bay Area counties, had 54 percent of the vote. To pass, Regional Measure 3 needs only a majority of votes cast in all of the counties combined.

Regional Measure 3 was passing in all but two counties: Contra Costa and Solano. The measure’s strongest support was coming from San Francisco, where it had 65 percent of the vote. In Santa Clara County, it captured 61 percent.

Measure 3 took an early lead as mail-in ballots were tallied shortly after the polls closed at 8 p.m., with 52 percent of the vote. Its lead slowly increased as vote counts trickled in from around the region.

“We’ve got tough traffic challenges that are true obstacles,” said Carl Guardino, CEO of the Silicon Valley Leadership group and a spokesman for the Yes on RM3 campaign. “The voters saw that this measure was a good opportunity to do something about it.”

David Schonbrunn, head of the Transportation Solutions Defense and Education Fund, an environmental group that opposed the measure, acknowledge the measure appeared headed for victory and blamed it on San Francisco and Santa Clara County voters who don’t commute across bridges.

“That speaks to the profound unfairness of the way the measure was written,” he said. “Including Santa Clara in this was obviously unfair and was obviously intended to skew the results.”

Regional Measure 3 was placed on the ballot by the Metropolitan Transportation Commission in January after it was granted the authority to do so by the state Legislature, which also helped create the spending plan.

The measure would raise tolls on the Bay Area’s seven state-owned bridges — the Bay, Richmond-San Rafael, San Mateo, Dumbarton, Carquinez, Benicia and Antioch — by $1 in three steps: in 2019, 2022 and 2025. The Golden Gate Bridge, which is independently owned and operated, would not be affected by the outcome.

Auto drivers now pay tolls of $5 on all state bridges except on the Bay Bridge, where the charge is $6 during morning and evening weekday peak times and $4 at all other times. Weekend tolls are $5.

If the measure passes, it would raise funds for 35 highway and public transportation projects throughout the region as well as provide transit operating funds for ferries, regional express buses and the Transbay Transit Center.

Now Playing: Now Playing California primary: Live election analysis San Francisco Chronicle

Chronicle Live with Christine Pelosi San Francisco Chronicle

Election night with former SF Mayor Willie Brown San Francisco Chronicle

Chronicle Live with SF Mayor Mark Farrell San Francisco Chronicle

SF mayoral candidate Angela Alioto San Francisco Chronicle

Jane Kim mayoral candidate SFChronicle

SF mayor candidate Mark Leno on his favorite place in the city San Francisco Chronicle

Candidate for California Governor Gavin Newsom FoxLA

Meet the 4 leading candidates for California lt. governor KCRA

SF mayoral candidate Angela Alioto's favorite place SFChronicle

SF mayoral candidate London Breed SFChronicle

Projects include the second phase of the BART extension to downtown San Jose and Santa Clara, the Caltrain extension to downtown San Francisco, completion of the Marin-Sonoma Narrows widening, replacement of a variety of outdated interchanges, expansion of the regional ferry system and express lane network, and the purchase of more new rail cars for BART and San Francisco’s Muni Metro.

Supporters, including Bay Area business and urban planning groups, said the measure was needed to help reduce the region’s growing traffic congestion and ease increasingly long commutes.

As election day neared, proponents ran television ads featuring “a traffic engineer, not a bureaucrat” who promoted popular projects in different parts of the Bay Area but didn’t mention the toll hikes.

The Yes on RM3 campaign cited major funding from Facebook and Kaiser Foundation Health Plan, each of which contributed hundreds of thousands of dollars, and from BART director and San Francisco supervisor candidate Nicholas Josefowitz, a clean energy entrepreneur. State campaign finance records also show contributions of more than $5,000 from hospitals, technology companies, a bank, a real-estate company and a water company.

While no organized opposition surfaced, some big names did urge votes against Regional Measure 3, including Rep. Mark DeSaulnier, D-Concord. He argued that the increased tolls would hit East Bay residents, particularly those in Contra Costa County, hardest without giving them as much benefit as other parts of the Bay Area.

In the South Bay, critics like Cupertino Vice Mayor Rod Sinks argued that the measure steered too much money to San Jose and not enough to the traffic-choked west side of Silicon Valley.

Michael Cabanatuan is a San Francisco Chronicle staff writer. Email: mcabanatuan@sfchronicle.com Twitter: @ctuan