Satellite Radio firm Sirius XM has avoided a bankruptcy filing, confirming Tuesday morning a deal with John Malone's Liberty Media that will provide it with cash infusions in return for a minority stake in the company.

With the agreement, Malone, for now, beat out Charlie Ergen's EchoStar, which has amassed Sirius debt and had proposed financing the satellite radio firm in return for a controlling stake.

The Wall Street Journal had reported Monday night that Liberty and Sirius were likely to strike the deal, which leaves Mel Karmazin in place as Sirius CEO.

The agreement will allow Liberty to look for synergies between satellite TV DirectTV, which it controls, and Sirius, even though the two wouldn't be combined.

Liberty will invest up to $530 million in Sirius in two stages.

The first phase includes a $280 million senior secured loan, $250 million of which will be provided today to repay debt due today and provide cash for general corporate purposes.

The second phase is an additional loan of $150 million to Sirius unit XM. In addition, Liberty agreed to offer to purchase up to $100 million of the unit's loans outstanding under existing credit facilities.

If the second phase is completed, Sirius will issue Liberty 12.5 million shares of preferred stock that can be converted into 40% of the common stock of Sirius.

Liberty will get seats on the Sirius board proportionate to its equity ownership, with chairman John Malone and CEO Greg Maffei expected to take seats.

If Sirius hadn't reached a financing deal, a Chapter 11 bankruptcy filing could have become necessary as early as tonight.

Amid the global credit crunch, Sirius has struggled with a big debt burden after the merger that created the company last year.

"Liberty's investment is an important validation of what Sirius XM has already achieved and a vote of confidence in what we will achieve," said CEO Karmazin. "This agreement enables Sirius XM to continue to develop the opportunities first outlined in the merger of Sirius and XM."

Maffei said Liberty is "excited to be investing in Sirius XM," adding: "We have been impressed with the company, its operations and management team."

He particularly cited Sirius' ability to grow subscribers and revenue in a difficult financial and auto market, arguing that this "is indicative of how listeners view this as a "must have" service."