The Pentagon on Thursday announced a contract with Oracle worth almost $7 billion over a decade, a big win for the software maker, which has been punished by investors this year. The stock rose about 3% in extended trading.

The contract covers the use of Oracle software in on-premises data centers for branches of the military, the U.S. intelligence community and the Coast Guard, according to a statement. The Central Intelligence Agency was Oracle's first customer.

Kirsten Davies, the Department of Defense's chief information officer, said in the release that the agency is saving at least $441 million for taxpayers "by fundamentally improving how we procure on-premises Oracle capabilities."

Earlier this week, Defense Secretary Pete Hegseth estimated that the war in Iran, which began in February, has cost the U.S. $37.5 billion.

Oracle co-founder Larry Ellison has long been a supporter of President Donald Trump, reportedly contributing $45 million to a nonprofit backing Trump's 2024 presidential campaign.

Ellison was among the first guests to appear in the White House during Trump's second term, announcing plans for Stargate artificial intelligence data centers in the U.S. Trump supported Oracle taking a stake in TikTok's U.S. business, and in May, the Defense Department announced agreements with Oracle and other tech companies around AI deployments in classified networks.

Still, Oracle shares are down 38% this year, as investors have grown concerned that AI could hurt growth prospects for software incumbents. The company is also racking up tens of billions of dollars in debt to build out AI data centers.

Oracle said in June that quarterly software revenue declined 2% from a year earlier, though the company's database software is widely used inside large companies. Cloud revenue climbed 47% as the company rushes to supply AI computing power to OpenAI and other clients.