WASHINGTON — More Americans bought homes in May, a sign of economic strength that is pushing up average prices.

The National Association of Realtors said Monday that sales of existing homes climbed 5.1 percent last month to a seasonally adjusted annual rate of 5.35 million. May was the third consecutive month of the sales rate exceeding 5 million homes, putting home-buying on pace for its best year since 2007.

Solid hiring since 2014 and relatively low mortgage rates have stirred up demand and helped generate more first-time buyers, though rising sales have fueled spiking prices because relatively few properties are listed for sale.

"We can credit that to the stronger job market, a more confident consumer" and some additional listings in an otherwise tight market, said Jennifer Lee, a senior economist at BMO Capital Markets.

Some of the buying might also reflect a rush to capture the benefits of lower interest rates and relatively cheap prices that are jumping higher each month.

"There may be some anticipation of prices going even higher, which is sparking a move off the sidelines," Lee added.

Median home prices climbed 7.9 percent over the past 12 months to $228,700, about $1,700 shy of the July 2006 peak.

The market has just 5.1 months' supply of homes, versus an average of six months in a healthy market.

Economists say that the sales gains of recent months could be short-lived if prices increase so sharply buyers are priced out of the market. The recent rise in mortgage rates could also curtail sales, similar to the higher mortgage rates slashing into sales in the middle of 2013.

Still, real estate has begun to show some strength after muddling through much of the six-year recovery from the recession that has left millions of Americans still owing more on their mortgages than their homes are worth.

Sales jumped in all four major geographic regions: Northeast, Midwest, South and West. First-time buyers also accounted for a growing share of sales, a sign that younger buyers are returning to the market after enduring an economic downturn and sluggish rebound that delayed their purchases.

About 32 percent of the homes sold last month went to first-timers, compared to 27 percent a year ago. The improvement is substantial but still lags behind the historical average of first-time buyers composing 40 percent of the market.

More Americans signed contracts to buy existing homes in April — which should translate into more finalized sales in the following months. The Realtors' seasonally adjusted pending home sales index climbed 3.4 percent to 112.4 in April, the highest reading since May 2006.

Sales of newly constructed homes through the first four months of the year are up 23.7 percent compared to the same period in 2014, according to the Commerce Department.

Builders are gearing up to meet the additional demand.

Approved building permits in May surged 11.8 percent to an annual rate of 1.28 million, the strongest reading since August 2007, according to the Commerce Department. Construction firms are breaking ground on more houses and apartment complexes, with the government reporting a 6 percent increased year-to-date.

Much of that growth stems from the spillover effect from a stronger jobs market. Employers have added 3.1 million jobs over the past 12 months, increasing the total number of paychecks in the economy and the likelihood that more Americans will shop for homes.

Low mortgage rates have also helped, although rates are now starting to steadily rise in ways that might limit sales later in the year.

Average 30-year fixed rates were 4 percent last week, according to the mortgage giant Freddie Mac. That average has increased from a 52-week low of 3.59 percent.