The typical middle class household saw its income fall by 1.4% during the economic downturn. But in 21 states and the District of Columbia, income rose between 2007 and 2010.
NEW YORK (CNNMoney) -- For the typical American household, income fell during the recession. But middle class residents in some states were more fortunate than others.
Nationwide, median household income fell to $50,046 in 2010, down 1.4% from 2007, according to Census statistics released last week.
But while the Great Recession wreaked havoc across the nation, wide disparity among the states shows that not all the pain was shared equally. Some Americans were still able to get ahead despite soaring unemployment and the housing collapse.
In 21 states and the District of Columbia, households in the middle of the pay scale saw their incomes rise despite the recession, according to a CNNMoney analysis of the data. These lucky folks benefited largely from the growth of the federal government, higher energy and agriculture prices, and the rebound on Wall Street.
"There are parts of the country managing to do relatively well in this slow-growing economy," said Mark Vitner, senior economist at Wells Fargo.
Washington D.C. enjoyed the steepest spike in median income over the past four years. It soared a whopping 12.1% to $60,903 last year.
The area around the nation's capital also benefited. Virginia saw a 1.9% increase to $60,674, while Maryland's median income rose 1.1% to $68,854, making it the wealthiest state in the union.
"There's a lot of money going to federal contractors," said Vitner. "It's really helped drive growth in that part of the country."
Energy-rich states also got a boost in incomes, thanks in part to higher commodity prices and the drive to extract coal and natural gas from the ground. Some people landed good-paying jobs in these fields, while other residents enjoyed royalty payments from energy firms who wanted to drill on their land, Vitner said.
The median income in North Dakota jumped 11.2% to $48,670, the second largest bump, while Louisiana saw a 3.9 percent increase to $42,505.
Meanwhile, agriculture states such as South Dakota, Kansas and Iowa also got an income boost with demand for crops. And the rebound on Wall Street helped lift incomes in New York and New Jersey.
Of course, not every state was so fortunate. The housing bust crushed states like Nevada, which saw the biggest drop in median income. It fell 7.4% during the recession to $51,001. Florida and Arizona weren't far behind.
|What we want Apple to unveil at WWDC|
|Millennials squeezed out of buying a home|
|7 traits the rich have in common|
|Big Data knows you're sick, tired and depressed|
|Your car is a giant computer - and it can be hacked|
|Overnight Avg Rate||Latest||Change||Last Week|
|30 yr fixed||3.41%||3.42%|
|15 yr fixed||2.69%||2.69%|
|30 yr refi||3.43%||3.45%|
|15 yr refi||2.73%||2.72%|
Today's featured rates:
|Latest Report||Next Update|
|Home prices||Aug 28|
|Consumer confidence||Aug 28|
|Manufacturing (ISM)||Sept 4|
|Inflation (CPI)||Sept 14|
|Retail sales||Sept 14|