U.S. home resales rose in April to their highest annual rate in nearly two years and a falloff in foreclosures pushed prices higher, hopeful signs about the pace of recovery in the still-struggling housing sector.

The National Association of Realtors said on Tuesday that existing home sales increased 3.4 percent to an annual rate of 4.62 million units last month, the highest since May 2010.

Nationwide, the median price for a home resale jumped to $177,400 in April, up 10.1 percent from a year earlier. That was the biggest year-over-year increase since January 2006.

Distressed sales accounted for 28 percent of resales, down from 29 percent in March. NAR economist Lawrence Yun said a drop in foreclosures fueled the decline in distressed sales, which in turn drove the increase in the median sales prices.

March's sales pace was revised marginally lower to 4.47 million units from the previously reported 4.48 million units. Economists polled by Reuters had expected sales at a 4.60 million-unit sales pace last month.

Inventories rose to 2.54 million, which Yun said was largely due to seasonal factors because many homes go on the market in the spring.