Deal for Home Partners of America, owner of over 17,000 houses in U.S., is latest sign Wall Street believes housing market will stay hot.

Blackstone Group Inc. has agreed to buy a company that buys and rents single-family homes in a $6 billion deal, a sign Wall Street believes the U.S. housing market is going to stay hot.

The investment firm confirmed Tuesday that it has reached a deal to acquire Home Partners of America Inc., which owns more than 17,000 houses throughout the U.S. Home Partners buys homes, rents them out and offers its tenants the chance to eventually buy. The deal had been reported earlier by The Wall Street Journal.

U.S. home sales soared last year at their fastest pace in 14 years, when low mortgage rates and the rise of remote work during the pandemic sent buyers scrambling to find larger living spaces.

The lack of homes for sale relative to demand and record housing prices have slowed the pace of home sales in recent months. But on a historic basis, the market remains red hot, and analysts say demand from millennials entering their prime homebuying years is expected to fuel demand for years to come.

The median price for existing homes topped $350,000 for the first time in May, the National Association of Realtors said Tuesday. “That supply-demand imbalance will not be fixed overnight,” said Kathleen McCarthy, global co-head of Blackstone Real Estate.

Blackstone was among the big investment firms to buy houses in bulk in the aftermath of the subprime crisis, when lenders sold off foreclosed homes at marked-down prices. The New York firm built a portfolio of tens of thousands of single-family homes, then rented them out through a company called Invitation Homes Inc.

In 2019, Blackstone exited from the single-family rental business when it sold its last shares in Invitation Homes, which had become the largest U.S. firm in this industry with 80,000 homes for lease. The firm put its toe back in the market in 2020 by investing $240 million to buy a preferred equity stake in Toronto’s Tricon Residential Inc., which buys single-family rentals in North America.

Blackstone’s deal for Chicago-based Home Partners shows that the investment firm is turning even more bullish on U.S. housing.

The firm is rejoining an expanding roster of Wall Street powerhouses that have acquired single-family rental companies. Canadian property giant Brookfield Asset Management Inc. recently acquired a stake in a landlord that owns more than 10,000 U.S. homes. J.P. Morgan Asset Management and Rockpoint Group LLC also have made big investments in single-family rental operators.

The business is attractive to investors because growth can come from both rising home prices and rent increases. The S&P CoreLogic Case-Shiller National Home Price Index, which measures average home prices in major metropolitan areas across the nation, rose 13.2% in the year that ended in March, up from a 12% annual rate the prior month.

The rental market showed signs of softness during the pandemic, especially in downtowns that saw an exodus of residents. But lately rents, too, have begun to rise.

Median asking rents rose 1.1% annually in March to $1,463 a month across the country’s 50 largest markets, according to a report from Realtor.com.

Many analysts say that with home-price gains showing little sign of easing, rents can continue growing throughout the U.S. as would-be home buyers are priced out of the sales market and are compelled to keep renting.

For all their recent activity, big institutional investors own about 300,000 U.S. homes, or only 2% of single-family rental homes, according to a report by New York-based financial firm Amherst Pierpont Securities LLC. About 85% of the single-family rental market is owned by investors with 10 or fewer properties, the firm said.

Home Partners, founded in 2012, has a different business model from Invitation Homes and some of the other big firms in the single-family rental business. It gives renters the option to buy at a predetermined price at any time with 30 days’ notice.

To that end, Home Partners limits its acquisition of new houses to those homes identified by people as ones they would possibly like to buy after renting.

Ms. McCarthy said about 20% of Home Partners’ renters have ended up exercising their options to buy their homes. She said she expects that rate to increase because, given recent home-price appreciation, many Home Partners renters buying today would likely be paying a price below current market value.

Blackstone is buying Home Partners through an investment fund named Blackstone Real Estate Income Trust, which primarily raises money from small investors and tends to hold assets longer than the firm’s opportunistic funds. That strategy is a sign that Blackstone thinks the housing market rally could last many years.

Home Partners chose Blackstone’s all-cash offer after a competitive bidding process, according to Blackstone. The deal is expected to close later this year.