NEW YORK - Mel Karmazin's Sirius XM Radio Inc won a reprieve from its debt deadlines on Tuesday after Liberty Media Corp agreed to lend $530 million to help the satellite radio provider fend off bankruptcy.

In return, Liberty, controlled by cable mogul John Malone, stands to take a controlling 40 percent equity stake in Sirius XM, the second largest U.S. subscription service after cable company Comcast Corp.

The deal comes after days of talks between the two companies as pressure mounted on Karmazin to raise funds to address some $1 billion in debt due this year.

Karmazin said in a statement that he was pleased with the agreement, particularly in light of today's challenging credit markets, and that it would enhance Sirius XM's capital structure and financial flexibility.

Analysts said the deal was the best option for Sirius shareholders, who would have been shut out had it filed for bankruptcy. Still, its hefty debt obligation remains: Sirius' total debt is about $3.25 billion, and a portion of Liberty's loan alone will bear interest of 15 percent.

Their credit situation continues to be very tenuous, said Tuna Amobi, equity analyst at Standard and Poor's. They live to fight another day. The only concern is that the day is not too distant. They may get through (a debt payment in) May but December may prove critical if credit market doesn't improve.

The deal also helps Sirius Chief Executive Karmazin stave off a potential takeover bid by EchoStar Corp, whose CEO Charles Ergen also runs Dish Network, a rival to Liberty affiliate DirecTV Group Inc, the largest U.S. satellite television provider.

Ergen had purchased hundreds of millions of dollars of Sirius' debt, including $171.6 million in convertibles maturing on Tuesday.

Its books temporarily assuaged, Sirius must quickly address critical operational questions, such as how it will sustain growth as the automotive market founders and consumers, worried about their jobs and retirement accounts, rethink discretionary spending.

Moreover, the company must cut costs, analysts say.

Sirius XM has been unsuccessful in renegotiating some larger content contracts, Stanford Group analyst Frederick Moran, wrote in a note to clients, referring to deals with partners like Major League Baseball. We believe Sirius XM must devise a strategy to lower content costs to remain viable.

TRYING TO REFINANCE DEBT

Sirius has been trying to refinance debt since its acquisition of rival satellite radio provider XM, which was approved last July.

Under the agreement, Liberty would first provide a $280 million senior secured loan to Sirius XM, of which $250 million would be funded on Tuesday to help the satellite radio company repay the $171.6 million in notes due today.

Then Liberty would provide another $150 million loan to XM, Sirius XM's wholly owned subsidiary, and also purchase up to $100 million of XM's credit facilities.

Once the loans are completed, Sirius XM would issue Liberty 12.5 million shares of preferred stock convertible into 40 percent of common stock. Liberty would also receive seats on Sirius XM's board, and expects Malone and Liberty Chief Executive Greg Maffei to join the board.

Maffei told Reuters that Sirius XM is an attractive bet because it is a good company in unfortunate circumstances, with nearly 20 million subscribers. While there were few obvious technology or distribution synergies between Sirius and DirecTV, the two might be able to cooperate in marketing and mobile video partnerships, he said.

We've structured a very attractive investment, with security on the upside and on the downside, he said.

Analyst Thomas Eagan of Collins Stewart speculated that Liberty views the deal in a different way from EchoStar, with Ergen perhaps having eyed a broader strategic play in wireless services and video in cars and on mobile devices.

For John Malone, it's more of a financial investment, especially with a 15 percent rate. He had this venture fund with cash available and he figured this was a worthwhile investment, Eagan said.

Sirius XM Radio's bonds jumped on Tuesday, with its 9.625 percent bond due 2013 rising 16 cents to 53 cents on the dollar, according to MarketAxess.

Shares of Sirius doubled to 22.8 cents in early trading before paring gains to close up 52 percent at 16 cents.

(Additional reporting by Tiffany Wu; Editing by Dave Zimmerman, Richard Chang)