Libyans celebrate the fifth anniversary of the Libyan revolution, which toppled strongman Moammar Gaddafi, in Tripoli on Feb. 17. (Mahmud Turkia/Agence France-Presse via Getty Images)

If Donald Trump and Hillary Clinton really are our choices in the presidential election this fall, we’ll witness an ugly debate about the great wall of Mexico, emails, Trump University and, here and there, maybe trade or torture. But we also could hear a lot about a small North African country of 6 million people, Libya — and we should.

Trump will point to Libya as prime evidence of Clinton’s incompetence. He’ll claim she pushed for U.S. intervention in the 2011 revolution against dictator Moammar Gaddafi and the result was a disaster: chaos, civil war, a new base for the Islamic State and the slaying of a U.S. ambassador. Gaddafi, Trump now says, should have been left in place. Clinton might well respond that NATO’s air operation prevented genocide on a Syrian scale — and that Trump strongly supported the operation at the time.

Unlike a lot of what may pass for campaign debate, this would be an argument worth having. Libya is not only a story of U.S. failure but also a problem that the next president will have a chance to get right — whether he or she likes it or not. As the Pentagon brass have been warning with rising alarm, the Islamic State is methodically building a base in the country. It could become the new Islamic State headquarters if Iraq and Syria are overrun, and it could serve as an easy launching pad for attacks on Western capitals. Another U.S. plunge into Libya is a matter of when and how — not if.

Fortunately, news organizations have done some thorough reporting of what went wrong the first time. The New York Times published a recent series , and another account appeared in The Post last year. Poring over them, what’s striking is the degree to which President Obama, who ran against the war in Iraq, nevertheless repeated most of George W. Bush’s Iraq mistakes in Libya.

First was the failure to do any planning for “the day after” the dictator’s fall, a lapse that later prompted a rare admission of error from Obama himself. He said the United States and its NATO allies “underestimated the need to come in full force” after the war — just like Bush did in Baghdad.

Then there was the overreliance on smooth, English-speaking, exiled politicians who assured Washington that they could take over Libya and quickly build a new order. Clinton, according to the Times, was charmed by Mahmoud Jibril, the U.S.-educated head of an opposition council; like Iraq’s Ahmed Chalabi, who wooed the Bushes, Jibril proved to have far less influence in his native country than he did in Washington.

Last but not least was the U.S. decision to focus on political benchmarks while ignoring the mounting security problems. While militias looted weapons from Gaddafi’s stockpiles and forced interim authorities to put their gunmen on official payrolls, American diplomats worked on plans for quick elections. “It was the same mistake you made in Iraq,” French ambassador to the United States Gérard Araud told the Times.

Of course, Obama did not deploy hundreds of thousands of troops, as Bush did. But that may explain the main difference between Iraq and Libya. In Iraq, jihadist forces were all but wiped out by the U.S. military, which also trained and equipped a substantial national army. Had Obama not prematurely withdrawn all U.S. forces, the Islamic State might never have gained a foothold.

Some in the Obama administration seem to have taken the Libya failure as a lesson in the futility of all U.S. ventures in the Middle East. We tried occupying Iraq and Afghanistan, goes the logic; we adopted a light footprint in Libya; we stayed out of Syria altogether. In every case the result was a disaster. Maybe the Middle East is just too hard.

That, of course, is the Trumpian view. If there is an alternative, it will come, oddly, from Clinton, whose push for the Libyan intervention was in keeping with a broader inclination to assert U.S. power more frequently and with more muscle than Obama has.

She argued for a greater U.S. commitment to Libyan security after Gaddafi’s downfall, and for military support of Syrian rebels, only to be overruled by the White House. She appears to understand that the serial U.S. failing in the Middle East was not that it tried but that it did not try hard enough. Washington failed to plan, minimized resources at crucial moments and pulled out too quickly.

Clinton’s answer to a congressional committee grilling her on Libya last year contains the seeds of a doctrine. “America must lead in a dangerous world,” she said. “When America is absent . . . extremism takes root, aggressors seek to fill the vacuum and security everywhere is threatened.” That would make a good answer when the campaign debate turns to Libya.

Read more from Jackson Diehl’s archive, follow him on Twitter or subscribe to his updates on Facebook.