SAN FRANCISCO — An estimated half-million illegal immigrants live in the Bay Area, according to a study that is one of the first to try to measure the number of local residents living in the U.S. illegally.

The report by the Public Policy Institute of California used tax returns, previous national estimates and mathematical models to determine that 563,000 illegal immigrants live in the Bay Area, about 8 percent of the region’s total population.

Santa Clara County leads the Bay Area with 180,000 illegal immigrants, followed by Alameda County with 124,000 and Contra Costa County with 79,000, the study found.

“Unauthorized immigrants are a part of our communities. They’re not just in a few pockets,” said demographer Laura Hill, who is a co-author of the report. “This isn’t a situation that is isolated to one or a few counties. These folks are likely to be pretty well-integrated in the places where they are.”

Illegal immigrants make up 12 percent of the population in wine-growing Napa County, one of the highest rates after Monterey and San Benito counties, where they make up 13.5 percent of the population, and Imperial County, along the Mexican border, where they make up 12.8 percent. Illegal immigrants represent 10.2 percent of the population in Santa Clara County and 8.4 percent in Alameda County, according to the study.

The researchers also surmise that the population appears to be dropping, at least in older urban areas, as immigrants try their luck in inland California and other states.

Several other studies have found the state’s illegal immigrant population, estimated at 2.6 million last year, to be steady or dropping even as it rises in Texas, Florida, North Carolina and other Southern states.

The study relied heavily on the number of California residents filing taxes using an Individual Taxpayer Identification Number, or ITIN, which is for taxpayers who do not have a Social Security number. Examining those tax records by ZIP codes found many of the applicants living in immigrant-heavy urban neighborhoods, such as in San Jose, San Francisco’s Mission district, Oakland’s Fruitvale district and the east and west ends of Contra Costa County, but also in rural areas such as the Salinas Valley where undocumented immigrants work in the fields. Even in the suburbs, however, many neighborhoods in the East Bay and Silicon Valley have populations where at least 5 percent of residents lack the proper documents to live in the United States.

Neither immigrant advocates nor those working to reduce the number of illegal immigrants were surprised by the statistics, but they interpreted the significance of the numbers differently.

“As in other parts of the state, people who live in the Bay Area interact with these immigrants every day. They are their neighbors, their co-workers, they may be part of their families,” said Reshma Shamasunder, director of the California Immigrant Policy Center.

Shamasunder said the decline of undocumented immigrants in the state and its coastal areas probably reflects larger trends as many California residents seek to move to places with a lower cost of living and more job opportunities.

Others have been kicked out. The federal fingerprint-sharing Secure Communities program has led to the deportation of 4,300 Bay Area residents arrested by local police since the region’s nine counties joined the dragnet last year, according to government statistics. That represents fewer than 1 percent of the region’s total number of illegal immigrants, according to the new study, which is based on 2008 data.

An East Bay advocate for reducing immigration doubted suggestions that the state’s population of illegal immigrants is steady or declining. The Department of Homeland Security thinks California’s illegal immigrant population dropped by about 250,000 in 2008 and 2009, but Yeh Ling-Ling of the Orinda-based Alliance for a Sustainable USA said that is barely a dent in a population that costs U.S. citizens jobs and money.

“I personally do not believe that the illegal immigrant population is going down,” she said.

“Even if it has been down, the reduction is very insignificant. Even if they’re not in California, they’re in other parts of the country, and American taxpayers have to bear the costs.”