Realogy stock surged more than 25% in Tuesday's premarket after it announced a deal with Amazon.

The largest residential real estate brokerage company in the nation is partnering with the largest online retailer in the world in a strategy designed to boost sales for both.

Realogy and Amazon will now offer TurnKey, a program that takes potential homebuyers through the Amazon portal and connects them to a Realogy agent. Once they purchase a home, they then get complimentary Amazon Home Services and products worth up to $5,000.

Realogy, which owns such brands as Coldwell Banker, Century 21, Sotheby's International Realty, Corcoran, ERA and Better Homes and Gardens Real Estate, has been up against stiff competition from newcomers like Compass and Redfin, both of which rely heavily on high-tech, online platforms. Partnering with Amazon gives Realogy a platform unlike any other.

"We're the market leaders in this industry and we like that position, but you always have to be innovating to stay ahead, you've got to be willing to cannibalize yourself, you've got to do all the things that a big successful company needs to do to stay on the forefront," said Realogy CEO Ryan Schneider.

"In a world that is awash with low quality lead generation out there, where you can get real estate leads from millions of online websites, giving an agent and franchisees high-quality leads from a source like Amazon and Realogy together is a real differentiator that's going to be very powerful for the group."