Amazon claims Donald Trump pressured the Pentagon to deny it a lucrative cloud computing contract because of his dislike for Jeff Bezos.
In a lawsuit unsealed on Monday the company said that the President views the Amazon chief executive as his "political enemy" and denied the firm the $10bn (£7.6bn) "JEDI" contract even though it was the most qualified to carry it out.
The President "launched repeated public and behind-the-scenes attacks" on the company to ensure it was given to rival Microsoft, the partly-redacted lawsuit alleges.
Amazon, which is the market leader in cloud computing services, was long considered the clear frontrunner for the deal, but legal challenges and investigations, including an allegation that a Pentagon official, who used to work for Amazon, was unfairly biased towards his former employer, led to reviews which held up the process.
In July Oracle lost a lawsuit claiming that the procurement process had been tainted by this alleged conflict of interest.
This April the contenders were narrowed down to Amazon and Microsoft, and in October it was awarded to Microsoft. The Joint Enterprise Defense Infrastructure contract is thought to be worth up to $10bn over the upcoming decade, as well as being a seal of approval that could help companies win similar contracts abroad.
President Trump has launched repeated attacks on Mr Bezos, who also owns the Washington Post, a newspaper which has investigated the president and his associates since before he entered office in 2016. He has also attacked Amazon, claiming it does not pay enough tax and rips off the US post office.
The lawsuit claims that the President "has made no secret of his personal dislike for Mr Bezos, Amazon, and the Washington Post, or of his express desire to harm them."
"Rarely, if ever, has a President engaged in such a blatant and sustained effort to direct the outcome of a government procurement - let alone because of personal animus and political objectives," the lawsuit adds.
Mr Trump and his family also publicly criticised Mr Bezos and Amazon throughout the procurement process, with Donald Trump Jr tweeting this summer that they had engaged in "shady and potentially corrupt practices."
In July, when the contenders had been whittled down to Amazon and Microsoft, the President announced that he would look into the awarding of the contract, saying "some of the greatest companies in the world are complaining about it".
"Each of these messages came while DoD was evaluating the JEDI proposals and it would have been virtually impossible for anyone involved in JEDI to ignore them," the lawsuit claims.
Elissa Smith, a spokeswoman for the Department of Defense, said: "This source selection decision was made by an expert team of career public servants and military officers from across the Department of Defense and in accordance with DoD's normal source-selection process.
"There were no external influences on the source selection decision.
"The department is confident in the JEDI award and remains focused on getting this critical capability into the hands of our warfighters as quickly and efficiently as possible."