CAIRO — The United Arab Emirates was shipping weapons to favored belligerents in Libya over the summer in violation of an international arms embargo while simultaneously offering a highly paid job to the United Nations diplomat drafting a peace accord there, leaked Emirati emails show.

The leaked correspondence is threatening to undermine months of Libyan talks by tarring the diplomat with an apparent conflict of interest. The emails also open a new window into the hidden and contradictory machinations of regional players like the United Arab Emirates that have helped inflame the fighting even as their diplomats say they support a peaceful solution.

“The fact of the matter is that the U.A.E. violated the U.N. Security Council Resolution on Libya and continues to do so,” Ahmed al-Qasimi, a senior Emirati diplomat, wrote in an email on Aug. 4 to Lana Nusseibeh, the United Arab Emirates’ ambassador to the United Nations.

The emails, disclosed here for the first time, were provided to The New York Times through an intermediary critical of the country’s muscular foreign policy. Representatives of the Emirati government declined to comment on the leaks.