THE MASSACHUSETTS POPULATION has continued to migrate from the more rural western parts of the state to the dense Boston region over the last decade, according to new data released by the US Census Bureau Thursday.

“We’ve seen our cities grow dramatically,” said Secretary of the Commonwealth William Galvin.

This will result in a power shift toward urban areas as larger metro regions gain more political representation, since the census’s decennial count is used to draw legislative and congressional districts. It is also used to distribute federal funding for the next decade. The data show the state has also gotten more diverse over the last decade, which could also affect political representation.

Nationally, Marc Perry, senior demographer at the US Census Bureau, said the country over the last decade grew at its slowest rate since the 1930s, with more than half of all counties losing population between 2010 and 2020. As has been the trend since the 1990s, there was more growth in the South and West, and less in the Northeast and the Midwest. Americans tended to move into the cities and large metro areas.

Massachusetts, with just over 7 million residents, is the 15th most populous state. Its population growth of 7.4 percent over the last decade is in line with the growth rate in the US and makes it the fastest growing state in New England.

In Massachusetts, the data show that between 2010 and 2020, two counties lost population: Berkshire and Franklin, which are both rural communities that have long struggled with declining and aging populations. There was also minimal growth in the other two western counties, Hampshire and Hampden.

There was more population growth in the more urban areas in central and eastern Massachusetts. Boston gained 58,000 residents, for a total population of over 675,000, which will be enough to earn it an additional legislative seat. Galvin said four cities reached populations of over 100,000 for the first time: Lynn, Quincy, Brockton, and New Bedford. The fastest-growing city was Revere, which grew by 20 percent in a decade, to 62,100 residents.

Worcester, the second largest city, exceeded the 200,000 mark for the first time. The third largest city, Springfield, grew slightly to 156,000 people. Cambridge and Lowell, the fourth and fifth largest cities respectively, also made significant population gains. The only city to lose population was Holyoke.

One other area of population increase was Cape Cod and the Islands, which actually had the counties with the largest growth rates, Dukes County on Martha’s Vineyard and Nantucket County. Nantucket, for example, grew from 10,200 residents to 14,300 over the last decade. Primarily older residents are moving there, with both Nantucket and Dukes counties showing large increases in the percentage of residents over 18.

On a county level, Suffolk County, which includes Boston, had the next highest growth rate after the two small Cape counties, increasing its population by 10.5 percent in the last 10 years, from 722,000 residents to 798,000. The most populous county, Middlesex County, had the largest number of new residents – 129,000 – bringing its population to 1.63 million.

Galvin attributed much of the new population to immigration, particularly foreign-born immigrants. He said some residents have also moved from other states, attracted by jobs and a strong economy.

Galvin said the shifts will require some challenging redrawing of congressional districts. For example, the four Western Massachusetts counties will no longer have the population to sustain two congressional districts without incorporating additional people from Worcester County. Districts in northeastern Massachusetts may have to shrink geographically.

The data could also affect the debate on Beacon Hill over how to increase the supply of housing, which has long been a priority of Gov. Charlie Baker’s. The data show that while the population has increased on Cape Cod, the housing supply has not. Over the last decade, the housing supply on the Cape and Islands has stagnated, with less than a 3 percent increase in homes in any of its three counties. Only rural Western Massachusetts, where the population is declining, saw fewer new houses being built.

Housing in Suffolk County increased by 10.8 percent, on par with its population increase.

Massachusetts has also gotten more racially and ethnically diverse, though it still falls in the middle of the pack among states when it comes to diversity.

The Census Bureau developed a diversity measure to determine the probability that any two people chosen at random in the state will be from different race and ethnicity groups. Massachusetts had a diversity index of 40.4 percent in 2010 and 51.6 percent in 2020, moving from 27th among states to 26th. The most diverse county was Suffolk County. The least diverse was Franklin County.

According to the new data, Massachusetts is 67.6 percent white and 12.6 percent Latino. Asians surpassed Blacks in this census to become the third largest racial or ethnic group in the state, at 7.2 percent. (A Census Bureau analysis only listed the three top racial and ethnic groups, so did not say the percentage of the state that is Black.)

Barnstable, Berkshire, and Franklin counties  were the whitest counties, with White populations of over 84 percent. Suffolk County was the only county where less than half the population (44 percent) was White. In Suffolk County, 22 percent of residents identify as Hispanic or Latino and 17 percent are Black.

The racial data will be of particular interest to groups trying to increase representation among people of color in government. The Drawing Democracy Coalition, a group of civil rights, immigrant, and public policy organizations, said it plans to propose a “unity map” that will focus on increasing representation among people of color.

“Redistricting is a once-in-a-decade opportunity to better ensure authentic representation and open new opportunities for building power for BIPOC, immigrant and low-income communities,” the coalition said in a statement.

It will now be up to the Legislature to draw new legislative district maps based on the data, while municipalities draw their local wards and precincts. There has been some controversy this year over which body will go first.

The Legislature finishes its session this November, and there will be pressure to get the districts drawn by then. It is particularly important for House members, who must live in their districts for a year before the election, to know their district boundaries by November 2021. The new districts will need to be voted on by the House and Senate, then signed by the governor. In past years, redistricting has also led to litigation.