United Arab Emirates officials have engaged in secret talks with a Libyan military commander seeking the Gulf state’s help in exporting Libya’s oil outside of United Nations-approved channels, Libyan, Emirati and European officials said.

Under international pressure, Mr. Haftar on Wednesday backed away from his plan, which would have violated U.N. National Security Council resolutions that ban any export of Libyan oil except through the country’s National Oil Co. in Tripoli. The U.S., U.K., France, Germany and Spain had vowed action last month against any such effort…