Nevada’s strong migration gains flipped to a net loss of 4,000. Arizona scraped by, ending the decade with a 5,000 net gain, down from 90,000 five years earlier. Maricopa County in Arizona, home to Phoenix, and Clark County in Nevada, home to Las Vegas, two areas that had exploded with growth at the start of the decade, began to see more people move out than move in.

On the other hand, New York had a net loss of 71,000 migrants in 2009, substantially fewer than the 170,000 migrants it lost in 2005. California saw its loss of migrants shrink to 71,000 in 2009, down from 201,000 in 2005.

The I.R.S. data covered the period through the 2009 tax year, but offered a detailed picture of the country in April 2010, when many returns were filed.

The internal migration data does not include those who came to states from other countries or the natural increase of the population through births. Those changes are major drivers for overall population growth and continued to make the Sun Belt and Western states the biggest population gainers of the decade. And young people, who have long been the most reliable group of new migrants to cities, also appear to be less willing to move to the cities in the Sun Belt.

In an analysis of the American Community Survey data made public on Thursday, William Frey, a senior demographer at the Brookings Institution, found that large metropolitan areas with once-flourishing economies, like Atlanta, Phoenix and Riverside, Calif., are no longer magnets for Americans ages 25 to 34.

“These places that were getting real new interest amid the bubble are not seeing that anymore, and in a way it is making people give another place a second look,” Mr. Frey said. “The dynamics of high housing costs on the coasts and relatively affordable inland is starting to change so, in effect, that shuts off the merry-go-round.”

“If nobody can buy or sell their homes, there’s going to be a stagnancy,” he added.

Atlanta, which ranked third as a destination for young people in that age group from 2005 through 2007, sank to No. 23 in the period from 2008 through 2010, according to Mr. Frey’s analysis. Phoenix dropped to No. 17 from second place, and Las Vegas plummeted to No. 35 from 10th place.