Texas, like everywhere else, is getting older as baby boomers age. But it’s still one of the youngest states in the nation, new census data shows.

In 2016, the Lone Star State’s median age was 34.5 years, which made Texas the fourth-youngest in the country after Utah, Washington, D.C., and Alaska, according to U.S. Census Bureau data released this week.

Compare that with states such as Maine and New Hampshire, whose median ages were 44.6 and 43, respectively.

That relative youth, demographers say, is yet another sign of Texas’ economic allure.

Look at it this way: Texas’ overall population has been booming, as migrants both from other states and abroad flood into the state. Often, they’re following big corporations or hunting more house for their money than they can find on the coasts.

Now think of the people who are willing to pick up and move in pursuit of better opportunities, state demographer Lloyd Potter said.

“Our country’s demographic profile is aging and looks a lot different than it did two decades ago,” Lauren Medina, a Census Bureau demographer, said in a prepared statement. “We are really seeing the impact of the baby boomers who started turning 65 in 2011.”

Since the 2000 census, Texas’ median age has risen by about two years.

Demographers say the nation’s median age was pushed upward by the populations of largely white rural communities, which have been losing residents to cities.

In Texas, Potter said, that has played out in an aging of areas west of Interstate 35. And “retirement migration” to the Hill Country in particular has sped that up.

“There are fewer and fewer young people there,” he said.

Meanwhile, urban areas continue to become more diverse, growing their populations and getting younger in the process.

Potter pointed to Harris County, which includes Houston, as a prime example of many of the factors contributing to the state’s shifting demographics.

In 2016, Harris’ Hispanic population grew by 39,600, and its black population grew by 16,400. In both cases, that was the most of any county in the country.

Its population increase over the year was largely driven by Latino and Asian immigration. That’s not unlike Dallas, Potter said.

“Dallas and Harris counties — their population dynamics are very similar,” he said.

Steve Murdock, a former head of the U.S. census and now director of the Hobby Center for the Study of Texas at Rice University, said Texas will continue to rely on its minority communities to propel its economy.

"The future of Texas is increasingly tied to its minority populations," he wrote in an email. "How well they do is how well we all will do."