After 18 months of courtship and court cases, two massive deals that would have reshaped the U.S. health insurance industry have both been declared dead, blocked by judges who said they would do unacceptable harm to competition in the industry.

Now, the companies are right back where they started. Anthem Inc.'s $48 billion deal to buy Cigna Corp. was blocked by a federal judge late Wednesday, weeks after another judge halted Aetna Inc.'s bid for Humana Inc. Aetna and Humana have said they may appeal.

The question now becomes what the companies will do with the large piles of cash they allocated for the acquisitions, and whether they will try anew at fresh takeovers under a Trump administration, whose antitrust officials could be more amenable to large consolidations. They also could opt for something more conservative in the face of widespread uncertainty about the future of the U.S. health system.

"Cigna intends to carefully review the opinion and evaluate its options in accordance with the merger agreement," the Bloomfield, Conn.-based company said in a statement after the decision. Jill Becher, a spokeswoman for Indianapolis-based Anthem, said the insurer was reviewing the ruling and declined further comment.

Cigna Chief Executive David Cordani has estimated that his company will have $7 billion to $14 billion of deployable capital, with the high-end including extra debt the company could take on if it decided to make acquisitions.

"We have a track record of being very disciplined relative to our capital priorities and not allowing surplus capital to sit around," Cordani said on Jan. 11.

Humana may be a target, once again. Cigna or Anthem may make a bid for the Louisville, Ky.-based company, which specializes in the fast-growing business of selling private plans for the elderly, said Ana Gupte, an analyst at Leerink Partners. Cigna also could bid for WellCare Health Plans Inc., she said.

Also likely are conservative moves by the companies, such as buying back shares or investing in their own businesses, said Sarah James of Piper Jaffray. "The four deal stocks have been hoarding cash for 18 months, and now that the rulings have been announced, we believe the companies will look to deploy the capital," she said. "The companies will most likely favor share repurchases."

The Justice Department, along with the antitrust division that sued to block the deals, could be remade under new Attorney General Jeff Sessions.

"If health insurance companies are thinking of merging, and they don't really compete with each other then these decisions shouldn't discourage them," said Martin Gaynor, a professor of economics and health policy at Carnegie Mellon University. Companies with serious overlaps still could face obstacles, he said.

There also is the risk that Republicans will remake large parts of the U.S. health care system as part of their plan to repeal and replace the Affordable Care Act. Insurance executives may wait to see what parts of the industry the new administration and Congress favor before writing checks.

The ACA, which expanded the market for Medicaid health plans and for coverage sold to individuals, hasn't been a big driver of growth for any of the firms. Still, its demise could cut off a source of growth at a time when they are looking to expand.

"We expect potential buyers to take their time," said Thomas Carroll, an analyst at Stifel Nicolaus. "In our view, all potential buyers will sit back, see how the new administration reshapes U.S. health care and digest the deal commentary of the last year and a half."

Anthem also said it would pursue deals and buybacks as its "Plan B" if the Cigna transaction didn't go through. CEO Joseph Swedish has said he might attempt to expand in the Medicare Advantage market through acquisitions, for example.

The 18-month effort to get the deal done was marked by discord between Anthem and Cigna.

Last year, the companies accused each other of violating the merger agreement.

This hostility could continue.

With the deal off, Anthem owes Cigna a $1.85 billion breakup fee under the terms of the agreement. Anthem wouldn't have to pay the breakup fee if it could prove that Cigna committed a "willful breach" of the merger agreement.

The disputes, which spilled into court, harmed the deal's chances, said U.S. District Judge Amy Berman Jackson.

She called the hostility the "elephant in the courtroom."