It’s not hard to see why the White House could be drawn to General Hifter. Libya has the largest oil reserves in Africa, and the Trump administration reportedly sees Libya’s oil production as important in keeping global prices low. In the past year, General Hifter’s forces have secured oil facilities in Libya’s central and southern regions, boosting output. He has highlighted his role in fighting terrorists, garnering favor among parts of the American military and intelligence agencies. He allowed the C.I.A. to establish a base in the eastern city of Benghazi, which he controls.

General Hifter also has Libyan supporters. His promise to establish order has been welcomed by Libyans exhausted by years of chaos and outraged at the failings of the weak Government of National Accord.

Despite this allure, he does not serve American interests. Nor is he the national savior he purports to be. He claims to be eradicating militias and building a professional army, but his forces depend heavily on militias, some of whom have committed war crimes. His common labeling as an anti-Islamist is belied by his backing of Salafist armed groups. But most alarming is his apparent disdain for electoral politics: He has said that Libya is “not ripe for democracy.” The recent history of the Arab world shows that such absolutism is not a formula for stability.

In General Hifter’s case, the danger of more conflict is made even worse by the fact that he is not as strong as he seems. For all his aspirations, the general is unlikely to fully unite or subdue the country’s factions and militias. His rise to power could provoke resistance by groups that fear reprisals and a return to dictatorship.

To avoid an escalation, American diplomatic intervention is needed now. Many Libyans actually want more American involvement: In our conversations over the years, it is clear that the United States still retains credibility in Libya as a relatively honest broker, especially when compared with the Europeans and Arabs pursuing competing and narrow interests.

In the summer of 2018, when General Hifter’s forces seized oil facilities in central Libya, American diplomats, working alongside the U.N. envoy, prevented these vital assets from falling out of the control of the internationally recognized government in Tripoli.

In the current crisis, similar American resolve is needed again. The Trump administration should issue a public censure of General Hifter and press for sanctions — both its own and through the United Nations — against the general for subverting efforts at a peaceful settlement and violating Security Council resolutions. In the past, such punitive measures have been applied to other militia leaders who have attacked the capital.