Intercontinental Exchange Inc. has agreed to buy Black Knight Inc. in a deal valuing the mortgage software provider at about $13.1 billion, as the owner of the New York Stock Exchanges makes a huge bet on the future of the U.S. housing market.

ICE has agreed to pay $85 per share in cash and stock for the Jacksonville, Florida-based company, according to a statement. Bloomberg News reported on the potential takeover earlier.

ICE and other exchange operators have been branching into data and other areas of fintech in recent years as growth stalled in the traditional exchange business. Black Knight would complement Ellie Mae Inc., the mortgage-software provider that ICE agreed to buy for $11 billion in 2020.

The deal marks the latest aggressive move by ICE Chief Executive Officer Jeffrey Sprecher, a serial dealmaker who has been eager to expand the company into new markets via acquisitions. ICE even flirted with buying EBay Inc. in 2020. With Black Knight, he is essentially doubling down on the future of the U.S. mortgage market.

Black Knight’s software was used to service about 63% of the active first-lien mortgages in the U.S. in 2021, according to its most recent annual report. The company’s products also help originate loans and evaluate how much properties are worth, among other things.

“With our expertise in operating networks and marketplaces, our planned acquisition will bring to life a true end-to-end solution for the mortgage manufacturing and servicing ecosystem, benefitting aspiring and current homeowners across the United States,” Sprecher said in a statement.

The deal also marks a win for billionaire Bill Foley, founder of title insurance giant Fidelity National Financial Inc. Black Knight spun out from Fidelity National in 2017 and Foley remained chairman of Black Knight until last year. The deal values his 2.2% stake in Black Knight at about $288 million, according to data compiled by Bloomberg.

Black Knight had been exploring a sale after receiving takeover interest from private equity firms, Bloomberg News reported last month. Based in Jacksonville, Florida, the company provides software, data and analytics to the mortgage and home equity lending and servicing and real estate industries.

The deal is expected to close in the first half of 2023. Goldman Sachs Group Inc. and Wells Fargo & Co. advised ICE on the deal while JPMorgan Chase & Co. advised Black Knight.