Venezuela's cash-strapped government has quickly settled a lawsuit filed by a state-run Chinese company, making good on an unpaid bill and appeasing an important ally that holds billions in the South American country's debt.

The state-owned oil company PDVSA agreed to pay $21.5 million to a U.S. subsidiary of the Chinese company Sinopec. The payment is for a 45,000-ton shipment of steel rebar delivered in 2013.

The countries reached the settlement Monday, two weeks after Sinopec filed suit in a Houston federal court.

The dispute arose at a time when Venezuela is trying to renegotiate billions of dollars in foreign debt amid soaring inflation and U.S. sanctions.

China is an important ally for Venezuela, bankrolling its socialist administration to the tune of $65 billion.