New York CNN Business  — 

Amazon is considering its options for how to move forward following the decision to award a massive government contract to its competitor, Microsoft, according to a source familiar with the situation. One analyst said he “fully expects” Amazon to try to fight the decision in court.

The contract — called Joint Enterprise Defense Infrastructure, or JEDI — involves providing cloud storage of sensitive military data and technology such as artificial intelligence to the Department of Defense, and could result in a payoff of up to $10 billion over 10 years for Microsoft.

The contentious decision represents a major loss for Amazon (AMZN) and a boon to Microsoft (MSFT), especially as both companies have seen the growth of their cloud businesses slow in recent months. It also threatens to undermine Amazon (AMZN)’s position as the clear leader in the cloud industry and CEO Jeff Bezos’ title as richest man in the world.

Friday’s decision came after months of controversy and protest over the process for awarding the deal and President Donald Trump’s public criticism of Amazon, long considered the frontrunner.

“This is a game changer deal for Microsoft to win as this will have a ripple effect for years to come and speaks to a new chapter of [Microsoft] wining in the cloud versus Amazon,” Wedbush analyst Dan Ives said in a note to investors Saturday, adding that he thinks Amazon and others may challenge the decision in court.

The timing is especially painful for Amazon, which said it was surprised by the decision, calling itself the “clear leader in cloud computing.” The company’s stock was already down at the end of the week after it announced on Thursday a 28% drop in profits in the most recent quarter. At the same time Amazon is funneling money into speeding up its shipping capabilities, growth at its cloud services division, Amazon Web Services, is slowing. Amazon’s stock fell nearly another 1% in after-hours trading over the weekend.

Amazon Web Services has long been a key income driver for the company, generating a relatively small percentage of Amazon’s sales but a majority of its profits. And an additional $1 billion a year would have been a significant boost — AWS generated $25.7 billion in annual revenue last year.

Those big sales are thanks in no small part to AWS’s government and other public sector clients, including 5,000 government agencies and 10,000 academic institutions. It became the leader in government cloud contracts by seeking out federal business early on and becoming the first to achieve various security and procurement qualifications. In 2013, it received a breakthrough $600 million contract to provide cloud services to the CIA.

But maintaining its dominance required hanging onto those government deals, something Amazon failed to do with JEDI.

The loss of JEDI will likely hit Jeff Bezos directly and could cause him to again fall behind Microsoft founder Bill Gates as richest man in the world. Bezos owns roughly 57 million shares of Amazon — around 12% of the company. Compared to the beginning of last week, Bezos’ net worth has fallen more than $1 billion because of the effect of the tough earnings report and JEDI contract decision on Amazon’s stock.

Amazon likely wasn’t helped by Trump’s dislike of Bezos and the Washington Post, which he owns.

A new book written by the speech writer for former Defense Secretary Jim Mattis says that Trump called Mattis in the summer of 2018 and directed him to “screw Amazon” out of a chance to bid on the contract, according to the website Task and Purpose. Mattis declined to do that, according to the book. In June, Trump said his administration would carefully review the Pentagon’s contract plan after he said Amazon competitors, including Microsoft, complained about the process.

“The acquisition process was conducted in accordance with applicable laws and regulations,” the Department of Defense said in its announcement of the contract Friday. “All offerors were treated fairly and evaluated consistently with the solicitation’s stated evaluation criteria.”

The Department did not immediately return a request for comment Sunday.

Wedbush’s Ives said he projects the deal will ultimately add $10 per share to Microsoft’s stock.

“We brought our best efforts to the rigorous JEDI evaluation process and appreciate that DoD has chosen Microsoft,” Toni Townes-Whitley, Microsoft’s president of US regulated industries, said in a statement to CNN.

There are likely more big government deals to come. The Department of Defense on Friday said “additional contracting opportunities are anticipated.”

Gartner analyst Craig Lowery has estimated that just around 10% of the federal government has transitioned to the cloud. Ives said the market opportunity in providing cloud services to the DoD and other government agencies could reach $100 billion in the coming years. And now, Microsoft may have a leg up against Amazon in securing more of that business.

“We believe Microsoft and [CEO Satya] Nadella are popping the champagne tonight … while Bezos and Amazon are likely shocked they lost the World Series of cloud deals with JEDI,” Ives said.

Shannon Liao contributed to this report