It was mid-March and the vultures were circling Carnival Corp. , the largest cruise-line operator in the world.

The company, virtually shut down by the coronavirus outbreak, needed billions of dollars fast. With financial markets frozen, executives were forced to consider a high-interest loan from a band of hedge funds who called themselves “the consortium.” The group included Apollo Management Group, Elliott Management Corp. and other distressed-debt investors that sometimes take over the companies they lend to, people familiar with the matter said.

That all changed on March 23 when the Federal Reserve defibrillated bond markets with an unprecedented lending program. Within days, Carnival’s investment bankers at JPMorgan Chase & Co. were talking to conventional investors such as AllianceBernstein Holding and Vanguard Group about a deal. By April 1, the company had raised almost $6 billion in bond markets, paying rates far below those executives had discussed just days earlier.

The previously unreported tale of Carnival’s rescue shows how effective the Fed has been in turning the debt spigot back on for large corporations. Carnival may still founder if tourists shun cruises over the long term, and its new debt carries a far heftier price tag than previous offerings. But the immediate survival of the company, which employs about 150,000 people, is no longer in question.

Elliott’s owner, Paul Singer, and others have warned that this success story comes at a cost. The Fed could be setting the U.S. economy up for a harder fall down the road, they contend, by flooding markets with cash and spurring investors to prop up firms that may not be fit to survive.