The integrated Brazilian energy company Petrobras has secured a $10b loan from the China Development Bank (CDB) in exchange for supplying petroleum to Chinese companies. The state-owned oil producer withers under the worst crude market in decades, and faces more than double the loan amount in maturities over the next two years, The Wall Street Journal reported.

The loan increases China’s commitment to Petrobras that will go a long way to repay $12b of debts due this year, said a source involved in debt talks.

According to Reuters, Petrobras has about $130b in obligations, making it the world’s most indebted oil producer and one of the world’s most indebted non-financial companies.

The deal, details of which are still under discussion, was vaguely outlined during a May 2015 visit to Brazil by Chinese Premier Li Keqiang. At that time, Brazilian President, Dilma Rousseff, suggested the money could be used for drilling in the pre-salt geological formation, referring to large, ultra-deepwater oil deposits off Brazil’s coast that Petrobras is struggling to develop.