Walmart Inc. (WMT) and Microsoft Corp. (MSFT) are joining forces to take down a common rival: Amazon.com Inc. (AMZN).

In a statement, Walmart revealed it has penned a five-year deal for access to Microsoft’s suite of cloud solutions, including Azure and 365. Microsoft’s software, cloud-infrastructure alternatives to market leader Amazon Web Services, will be used by the retail giant to make shopping faster and easier for its customers.

Moreover, Walmart plans to tap into the Redmond, Washington-based company’s machine-learning, artificial intelligence and other technologies to optimize the performance of its equipment and help employers to pick products destined for supermarket shelves. An executive familiar with the plans told the The Wall Street Journal that Walmart and Microsoft are also in discussions about working on a new system to share product-sales data with suppliers.

In an interview with the newspaper, Microsoft CEO Satya Nadella was blunt while explaining why the two companies decided to team up, claiming that their shared rivalry with Amazon  “is absolutely core to this.” He added: “How do we get more leverage as two organizations that have depth and breadth and investment to be able to outrun our respective competition.”

Meanwhile, in the statement, Walmart, which is currently aggressively cutting costs and investing to grow its online sales platform, described Microsoft as a “strong partner.” (See also: Walmart Overhauls Website to Take on Amazon.)

“Walmart is a people led, tech empowered company, and we’re excited about what this technology partnership will bring for our customers and associates,” said CEO Doug McMillon. “Whether it’s combined with our agile cloud platform or leveraging machine learning and artificial intelligence to work smarter, we believe Microsoft will be a strong partner in driving our ability to innovate even further and faster."

Despite agreeing to partner up across several areas, Walmart is not believed to be interested in using Microsoft’s cashierless store technology at this stage, reportedly because the retailer is developing its own solution. Microsoft has been working on the technology, designed to eliminate the need for cashiers and checkout lines, as a solution to help retailers compete with Amazon Go, the e-commerce giant’s automated store concept. (See also: Tech Giants Challenge Amazon in June)

This is not the first time that Walmart has collaborated with one of Amazon’s technology rivals. Last summer, the Bentonville, Arkansas-based company agreed to list its products on Alphabet Inc. Google’s (GOOGL) online-shopping marketplace. Under the terms of the deal, customers can use Google Home, a rival of Amazon’s Alexa, to make voice orders.