By now, it is no secret that the housing bust hit black home buyers harder than whites. But a surprising new study shows that many new black homeowners also lost substantial wealth during the boom that preceded the bust.

First-time black homeowners saw their wealth decrease by nearly half between 2005 and 2007 — a time of red-hot appreciation for most homeowners, Johns Hopkins University researchers found in a new study published in the journal Real Estate Economics.

The stunning finding is a consequence of still segregated communities that often leave fewer people shopping and pushing up prices in black neighborhoods. Meanwhile, black buyers who choose to live in black areas often find themselves investing in declining communities.

While homeownership has worked well for many Americans through the decades as a wealth-building tool, it has proven trickier for African Americans who disproportionately are steered into subprime mortgages and, the new study shows, often end up in neighborhoods that prove to be poor investments.

The Hopkins study found that the financial losses suffered by first-time black home buyers during the real estate boom had everything to do with the most basic axiom of real estate investment: location, location, location. It turns out that first-time black homeowners tended to buy in mostly black neighborhoods that had lower-priced homes, higher poverty, and lower — and declining levels — of homeownership. That, in turn, led to lower rates of appreciation.

Those forces combined for a mind-boggling outcome: their net worth declined by 47 percent between 2005 and 2007. First-time white homeowners, by contrast, saw their net worth soar by an average of 50 percent during the same time period, according to the study.

“In real estate investment two of the main variables are timing and location, location, location,” said Sandra J. Newman, a Hopkins professor who did the study along with Hopkins researcher C. Scott Holupka. “What our analysis shows is that timing was everything for whites. But for black households timing did not really matter. Location made the difference.”

The researchers used a data set called the Panel Study of Income Dynamics, which follows the financial lives of thousands of families across generations, to cull their findings. The study found no significant difference in interest rates paid by blacks and whites, although researchers cautioned that it was impossible to tell whether the disparity was affected by subprime mortgages that other studies have determined were marketed more aggressively to blacks than whites.

Whatever the other causes, those losses came before the devastation wrought by the housing bust and the Great Recession. Between 2007 and 2009 black first-time home buyers lost an additional 43 percent of their wealth, while the decline for whites was 33 percent. Overall, blacks lost about half their collective wealth during the Great Recession, according to research by Brandeis University, leaving the typical white family with nearly 20 times the wealth of the typical black family. Meanwhile, their recovery has been slower because of lower homeownership rates and lagging home prices.

The findings call into question decades of federal housing policy that has encouraged homeownership for people with modest incomes as a means of building wealth and more stable neighborhoods. Although government policy pushed homeownership, many black home buyers would “have been better off remaining renters,” Newman said.

The researchers acknowledged that home equity remains the biggest source of wealth for most Americans. But their findings illustrate why home buyers have to be very careful about what neighborhoods they buy into if they hope to make money from their home. It is not enough to know that housing prices are going up in a particular city, they said, or even a particular Zip code. Instead, buyers need to figure out how prices are moving in each small neighborhood to have a better chance of having their purchase help them build wealth.

“There is more variation of experience out there than we often look at,” Holupka said. “We often talk in general about the nation’s housing values rising, when in fact it varies a lot within markets and depending on who the buyers are.”