OAKLAND — Their flight from the Bay Area and California to more affordable places was a cause for worry after the dot-com bust, but college graduates now are more likely to stay in the region, according to a population analysis released Wednesday by the Brookings Institution.

The "migration bubble" that swept people out of coastal California has ended — at least for now, said William Frey, a demographer with the Washington, D.C.-based research organization. For the first time this decade, more people moved from other states into the San Francisco metropolitan area last year than moved out.

The recession has made Americans less mobile, while it also reduced housing costs for those who preferred to live where they grew up.

"What we're seeing now is people who went out to the suburbs and the exurbs are now staying on the coasts or in the inner suburbs or even inside the city," Frey said. "They are increasing the populations of places that were losing a lot of people."

The overall rate of U.S. migration has reached its lowest point since World War II, which most demographers say is a symptom of economic troubles. At the same time, the flat-footing of residents could be a boon for some regions, especially cities, if they take advantage of it, he said.

"There's an opportunity, at least, for these cities and inner suburbs to show their stuff," he said.

Five years ago, California faced a net loss of more than 41,000 college graduates who moved to other states. In contrast, the state faced a small net gain of more than 4,000 college graduates last year.

Far fewer Californians left the state last year for the once-popular destinations of Arizona and Nevada, two states that have been made less attractive by foreclosures and diminished job opportunities. Texas is now the biggest draw for Californians — net migration from here to there was more than 32,000 residents — but the numbers heading there also have dropped.

Middle-class Californians appear to have retrenched, although experts disagree about whether that is a temporary halt that will end when the recession lifts or part of a longer-term trend. Those most likely to have moved out earlier in the decade — young Latino and white couples and singles with at least a moderate education level — are now keeping local as housing cost pressures ease, according to Frey's analysis.

California also continues to draw migrants from the Northeast and Midwest. Michigan, which has been hard-hit by foreclosures, dying industries and unemployment, had the highest net migration to California last year, adding about 4,200 people to the state.

Unlike other parts of the country, California and most of its cities never faced population declines this decade. While tens of thousands of people moved east to other counties and states, they were replaced by a steady flow of international migrants.

California's appeal to foreigners continues, though international migration to the state dropped significantly last year, according to the report.