Venezuela has struck a $1.4 billion deal to retain control of Citgo Petroleum Corp., the latest settlement that keeps the country’s U.S. crude refineries from falling into the hands of creditors.

The agreement resolves legal actions against state-owned Petróleos de Venezuela SA that sought to wrest control of Citgo, Venezuela’s U.S. refining subsidiary and a critical source of dollar revenues for the cash-strapped country.

The...