Home values in the Boston area increased by 1.8 percent in July compared with June, marking the fourth consecutive month of rising prices and the highest level in nearly two years, according to new data released Tuesday by S&P/Case-Shiller Home Price Indices.
The local figures aligned with the national trend — home values in July rose 1.6 percent in the 20 metro areas tracked by Case-Shiller, a national index that measures repeat sales and is widely considered the best barometer of the US real estate market.
The latest housing data add to a series of signs pointing to a local and national housing recovery.
The turnaround is being bolstered by low interest rates, tight inventory, and growing consumer confidence, many housing specialists and economists say.
Another set of data released Tuesday showed a steady upswing in Massachusetts home sales.
“All in all, we are more optimistic about housing. Upbeat trends continue,” said David M. Blitzer, chairman of the S&P index committee.
Karl E. Case, cofounder of the Case-Shiller index and a retired Wellesley College economics professor, said he is confident the country’s housing market has stopped declining, but he isn’t certain about how quickly it will rebound.
He cited the worldwide economy and tax reform efforts as issues that could affect the housing market in coming months and years.
“I don’t think it is going to come out like a rocket ship,’’ Case said. “There are so many uncertainties out there.”
Massachusetts has weathered the national housing crisis better than many other states. Still, home prices in the Boston area are down 13.8 percent compared with their peak in late 2005, according to Case-Shiller.
Nationwide, values are down about 30 percent compared with the market’s peak.
With the traditional fall home-selling season underway, potential buyers are out in droves in the state, with many motivated by a concern that prices may start accelerating.
Sales of Massachusetts homes — including condominiums and single-family residences — escalated in August for the seventh month in a row, according to numbers released Tuesday by Warren Group, a Boston company that tracks local real estate.
There were 5,118 single-family homes sold in Massachusetts last month, 20 percent more than during the same period in 2011, Warren Group said.
Sales between January and August are up 24 percent compared with those eight months last year.
Condo sales in August totaled 2,432, a 40 percent increase compared with August 2011, and the best showing for any month in more than two years, Warren Group reported.
Between January and August, condo sales jumped almost 28 percent compared with the same period in 2011.
“One more month of strong home sales confirms speculation that the housing market recovery is underway,’’ said Timothy M. Warren Jr., chief executive of Warren Group. “We are on the upswing.”
The median home price — meaning half of homes are priced higher and half lower — increased slightly in August, according to Warren Group.
The median price for a single-family home was $310,000, 1.6 percent higher than in August 2011. Between January and August, however, the median fell to $290,000, a 1.7 percent drop.
The median condo value fell 4.3 percent in August, Warren Group said, to $279,000. But the median price for the first eight months of 2012 increased to $279,900, up about 2 percent compared with last year, Warren Group said.
The Massachusetts Association of Realtors, which also released data Tuesday, reported that housing inventory continues to diminish.
The number of single-family homes for sale fell by 22 percent in August 2012 compared with that month last year, the association said. Inventory for condos fell by 30.1 percent.
Trisha McCarthy, association president, said agents are hearing from more interested sellers, but still not enough to meet the demand.
“We want more inventory in all price ranges,’’ she said.