Troubled business tycoon Anil Ambani was thrown a vital lifeline from his billionaire brother Mukesh Ambani which helped him avoid a three-month jail term in the Ericsson payout case.

Mukesh Ambani, India’s richest man, stepped in to bail out his younger brother by repaying money owed to Ericsson India by Reliance Communications (RCom) on Monday, a day before the deadline set by India’s Supreme Court. If he had not done so, Anil Ambani could have gone to jail for contempt of court.

The latest payout means that RCom has cleared itself of debt owed to Ericsson India. The company had already paid 1.18 billion rupees (US$17.22 million) of the 5.5 billion rupees ($80.27 million) owed. In addition, RCom had paid around 30 million rupees ($437,818) as penalties to Ericsson.

RCom was forced to shut its wireless operations in 2017 when it was weighed down by debts, falling revenue and widening losses. At the time, Ericsson was operating and managing RCom’s telecom network across India.

Apart from Ericsson, RCom has to clear its debts to 39 other lenders. Its total debt is estimated at around 450 billion rupees ($6.57 billion).

In a related development, RCom has decided to terminate its asset sale agreement with Reliance Jio, owned by Mukesh Ambani. RCom has cited delays in gaining approval from the government and lenders as the reason for the change in tack.

RCom had previously banked on the sale to pay off its debts. But the deal fell through after the Department of Telecom refused to clear the sale, claiming it failed to meet spectrum trading rules.