Rising income inequality has led to a growing number of Americans clustering in neighborhoods in which most residents are like them, either similarly affluent or similarly low-income, according to a new study detailing the increasing isolation of the richest and the poorest.

A report released Wednesday by the Pew Research Center said the percentage of upper-income households situated in affluent neighborhoods doubled between 1980 and 2010, rising to 18 percent. In the same time frame, the share of lower-income households located in mostly poorer neighborhoods rose from 23 percent to 28 percent. The percentage of neighborhoods that are predominantly middle class or home to a wider mix of income levels shrank.

“The country has increasingly sorted itself into areas where people are surrounded by more of their own kind, if you will,” said Paul Taylor, the Pew Center’s director of demographic trends and a co-author of the report, adding that the majority of neighborhoods in the country are still mostly middle class or mixed.

The Pew study is the latest scholarly analysis of census data showing the impact of a slow and steady squeezing of the middle class, which in turn has swelled the two income extremes. Because of a lag in the way census data are tabulated, the full impact of the recession that started at the end of 2007 will not become clear for several years.

What sociologists call “segregation by income” at the neighborhood level has been underway for decades, but the most recent census data suggest that the pace picked up between 2000 and 2010.

Pew found that the trend is most pronounced in the Southwest. The three cities with the most income segregation in the country are in Texas: San Antonio, Houston and Dallas. The study attributed that to an influx of, at one end, low-skilled and low-wage workers from Mexico and Central America, and at the other end, high-skilled workers and well-to-do retirees.

The Washington region experienced a small rise in the share of neighborhoods that can be characterized as mostly well-off or mostly low-income. Among the nation’s 30 largest metropolitan areas, Washington falls smack in the middle in terms of income segregation, placing it slightly above the national average, according to the study.

Pew calculated that the share of affluent households in the Washington area — those earning $171,000 or more — living in majority upper-income neighborhoods increased to 15 percent from 13 percent over three decades. Meanwhile, the share of households with incomes below $57,000 and living in lower-income neighborhoods rose to 32 percent from 31 percent.

Both Pew and a study by two Stanford University sociologists last year say the biggest factor behind the growing residential isolation is a rise in income inequality. The Stanford study said the share of families living in middle-income neighborhoods has dropped over four decades, from almost two-thirds to less than half.

Many other factors also are at play.

William H. Frey, a demographer with the Brookings Institution, sees a generational divide at work, particularly in big cities. The baby boom generation bought houses in neighborhoods where their children are now priced out.

“Younger people are still struggling to just buy a home, and the kind of neighborhoods where they end up are not nearly as nice,” he said. “Age isn’t a part of this study, but it underlies it.”

Frey said the types of developments that have fueled growth in suburbs and exurbs have exacerbated income segregation.

“They are where the McMansions were built,” he said. “As a result, these are areas segregated among the upper income.”

Sean Reardon, one of the Stanford sociologists, found a similar trend going back four decades. He said restrictions on lot size have limited the construction of cheaper houses and apartment buildings in many new developments. At the same time, he said, a lot of high-density, low-income housing has been torn down and replaced by low-density housing throughout cities.

Thomas Anderson, president of Washington Fine Properties, who has been selling real estate for more than 30 years in New York and the Washington area, said the high price of housing has added a new element to many buyers’ lists of must-haves. Many more home buyers now want to be sure that their neighbors have the financial wherewithal to maintain their properties and not have to enter into short sales, he said.

“The price of real estate is so high that people are concerned about their investment,” he said. “It’s counterproductive to work hard to invest in a home that’s going to be negatively affected by a short sale.”

The rising phenomenon of segregation by income — at a time when segregation by race is on the decline — may have implications for communities and politics.

Reardon said a neighborhood that lacks socioeconomic diversity could be less supportive of taxes to fund schools, parks and social services in other neighborhoods.

“If people with most of the money and wealth live separately from everyone else, there’s going to be less investment in the neighborhoods where the middle class and the poor live,” he said.