Money-losing diabetes drug researcher MannKind (MNKD 0.72%) caught a financial lifeline Monday, announcing that investment advisor Deerfield Management Company has committed to loan it $160 million.

Deerfield's support comes in the form of four $40 million tranches of senior secured notes the company will buy from MannKind. The first tranches will be bought, and monies disbursed, after closing of the loan agreement. The second, after the release of results from MannKind's two phase 3 clinical studies of Afrezza. The third, at the time MannKind repays its 3.75% senior convertible notes. And the final disbursement will be after FDA approval is granted for Afrezza.

The notes will pay 9.75% interest, and some but not all of their value may also be converted into common stock of MannKind at Deerfield's election.

Additionally, MannKind explained in an SEC filing that it has sold Deerfield, in exchange for an $18.9 million up-front payment, the right to receive up to $90 million worth of MannKind's own milestone payments due to the company on the occasion of its first commercial sale of an Afrezza product, and upon reaching certain levels of Afrezza sales. MannKind has the right to terminate this turnover of milestone payments to Deerfield in the event it pays back the first tranche of senior secured notes before they come due in 2019.