Sales of previously owned U.S. homes posted the best monthly gain in nearly three years in May, providing hope that housing is beginning to regain momentum lost over the past year.

The National Association of Realtors reported Monday that sales of existing homes increased 4.9 percent last month to a seasonally adjusted annual rate of 4.89 million homes. The monthly gain was the fastest since August 2011, but even with the increase, sales are still 5 percent below the pace in May 2013.