Housing inventory is low, real estate analysts say, and so prices are soaring.

The median selling price for a single-family home in Massachusetts has crossed $400,000 for the first time, according to a new report out Tuesday.

The state's median price was $410,000 in June — an increase of $30,000 over June 2016, according to the Massachusetts Association of Realtors (MAR).

We reported two weeks ago that the median home price had risen above $400,000. That report was based on pending sales; Tuesday's report was for closed sales, confirming the prices.

"We knew there was a good chance that the $400,000 barrier would be reached and passed," MAR President Paul Yorkis said in a statement Tuesday. "But the speed at which it did underscores what happens when there is very high demand coupled with very low supply."

MAR reported that housing inventory last month hit the lowest level for June since the agency started recording data, in 2004. June is typically a busy month for real estate transactions.

“The days on market reached a new all-time low this month," Yorkis added in the statement, "which is another indicator that people are snapping up houses as soon as they hit the market."

A separate housing snapshot, also out Tuesday, found a similar trend in prices, though not quite as high.

The Warren Group said the median selling price for a single-family home in Massachusetts rose to $395,000 last month — 6.2 percent higher than the price of $372,000 in June 2016.

"[T]he fact that the median is just a hair under $400,000 is unprecedented, and perhaps worrisome," Warren Group CEO Timothy Warren said in a statement. "The growth in the number of home sales has slowed due to the the fact that so few homes are for sale. Prices are being driven up, but are they sustainable?”

MAR said that sales of single-family homes fell 4.8 percent last month, when compared with June 2016. The Warren Group found that sales edged up last month, when compared with June 2016. The two organizations use different calculations for their monthly housing reports.

The groups both found prices for condominiums rose more than 3 percent year-over-year -- to a median of $361,500, according to MAR, and to $357,500, per the Warren Group.