The unemployment rate in both California and San Francisco fell to a record low in September, the state announced Friday.

The state added 21,300 jobs in September and had an unemployment rate of 4%, down from 4.1% in September 2018. California — the fifth-largest economy in the world if it were a country — now is in the midst of its longest record jobs expansion, 115 months, surpassing the economic boom of the 1960s, according to the Employment Development Department.

San Francisco’s unemployment rate fell last month to a minuscule 1.8% from 2.1% from the prior September, the lowest number the city has ever recorded.

Nationally, the unemployment rate fell to 3.5% in September, the lowest in 50 years.

Despite fears of a recession amid an ongoing U.S.-China trade war and the stumbles of high-profile tech companies like Uber, there are no major signs that the local economy is cooling, said Christopher Thornberg, founder of Beacon Economics in Los Angeles.

“Tales of this expansion’s demise are highly exaggerated. We don’t see any end to it,” Thornberg said.

Jobs numbers could be even stronger if more workers and housing were available in the state, Thornberg said.

“The biggest problem we have in the United States right now, which is (worse) in California, is the lack of labor,” he said. “Businesses are making money. They want to hire people. It’s becoming harder for them to do.”

The Bay Area has been at the heart of the state’s economic boom, with the San Francisco and San Jose metro areas rapidly adding high-paying tech jobs — though the fast-rising cost of housing and ever-worsening traffic are causing some companies to look to grow elsewhere.

In San Francisco, tech accounted for 15% of private-sector jobs last year — up from just 3% in 2004, according to a recent report from the city Office of the Controller. Thanks partly to tech, per capita personal income in the city soared from $82,000 in 2011 to $120,000 in 2017 — rising far faster than in the state as a whole, the controller’s office said.

San Francisco and San Mateo counties added 37,600 jobs between September 2018 and 2019 for a total of 1.19 million.

The economic boom has transformed the city with more than a dozen new skyscrapers in the past decade. Historically industrial neighborhoods like South of Market have added new offices and homes. Thousands of new, well-paid tech workers cram into shiny steel and glass towers. The city’s budget is projected to rise to a record $12.3 billion in the current fiscal year.

The city’s largest private employer, Salesforce, had 9,000 local employees at the end of September — up from 7,500 last year. To accommodate its growth, the company leased a fourth tower at 564 Howard St. in the Transbay district near Salesforce Tower.

Saturated roadways and scarce housing have sparked backlash from some residents who have called for slower job growth or more restrictions on office development. In San Francisco, Mayor London Breed and South of Market nonprofit Todco have backed dueling ballot measures for March. Breed’s measure would allow more office growth, while Todco’s would reduce it if the city fails to approve enough affordable housing.

Technology jobs have even lower unemployment rates than the national or San Francisco averages, said Cristina de la Cruz, regional vice president at recruiting and consulting firm Robert Half in San Francisco.

Nationwide, the unemployment rate is 0.9% for web developers and 1.1% for database administrators, said de la Cruz. “It’s a challenging market,” she said.

Companies are adding perks such as allowing employees to work remotely full time or part time, particularly in the Bay Area, where commutes can be a nightmare, she said. One high-profile example: Charles Scharf, the new CEO of Wells Fargo, which is San Francisco’s second-largest employer, will continue to live in New York.

Inadequate housing and transit are major hurdles, but strong job growth is evidence that companies are overcoming them for now, said Rufus Jeffris, a spokesman for the Bay Area Council, a business-backed public policy group.

“Despite these challenges, companies are still adding jobs and seeing this as a great place to start a business or grow their business,” he said. “This is an innovation center.”

The Bay Area Council and other business groups have pushed for more funding for housing and transit, including a proposed $100 billion transit tax over 40 years called Faster Bay Area, which is slated for the November 2020 ballot.

Thornberg said aside from technology, the health care and professional services sectors were expanding in the Bay Area. Restaurants are also performing well “because they can charge an astronomical amount,” he said, though challenges are more evident in the retail and hotel sectors, which struggle to retain staff.

Despite some tech companies cutting jobs — Uber laid off another 350 employees globally this week, including some at headquarters — the broader economy was unlikely to suffer, he said.

“Those people will get a job in a heartbeat,” said Thornberg.

Roland Li is a San Francisco Chronicle staff writer. Email: roland.li@sfchronicle.com Twitter: @rolandlisf