HARGEISA, Somaliland — To most Americans, anarchy, intervention, and the Black Hawk Down fiasco define Somalia. By any reasonable metric, the country has not improved much since. Somalia has had the dubious honor to be crowned the world’s most corrupt country by Transparency International for 14 years running. Terrorism is a weekly occurrence , and perhaps even a tool for some Somali politicians.

Somalia largely deserves its reputation. A generation of Somali politicians and clan leaders have siphoned off the billions of dollars which the U.S. government and other outside powers have invested in the country. The national Somali military, built to supplant the country’s patchwork of militias, exists largely on paper. In recent weeks, Somali elders, soldiers, and politicians have lined up to apologize to and swear allegiance to al Shabaab, an extremist group responsible for terrorism both inside and outside Somalia.

Somaliland, the northern third of the country and a former British protectorate, however, is a happy exception. It gained its independence (and U.S. recognition) in 1960, only to forfeit it days later when it entered into a union with the rest of Somalia. It was an unhappy marriage marked by dictatorship in Mogadishu and later genocide against the Somaliland population. Finally, in 1991, Somaliland left the union and reasserted its independence. Today, it is peaceful, stable, and even without international recognition, one of the most democratic countries in Africa. It is the first country in the world, for example, to use biometric iris scans for voter registration.

Alas, the State Department ignores Somaliland and instead operates under the fiction that Somalia works. Like a gambler who believes he can redeem his losses with just one more hand at the blackjack table, it continues to pour money into the country, never mind the historical reverse correlation in Somalia between aid and stability. This fiction and gambler’s addiction increasingly undermine vital U.S. national interests.

Historically, Somaliland’s greatest resource was livestock and, for better or worse, charcoal. Energy companies now explore for gas and oil both in Somaliland and Somalia.

The real strategic asset of Somaliland, however, might be rare earth metals.

Mining is a new industry, but already Somaliland is becoming a resource for the rare elements necessary for modern electronics and cutting-edge technology. China has tried to monopolize rare earth elements both to bolster its own economy and, for strategic reasons, to deny them to the United States.

Here is where the State Department strategy is so narrow minded. Somaliland officials say that Chinese companies are aggressive in seeking mining concessions in Somaliland. Somaliland, which has traditionally been both moderate in its outlook and pro-Western, prefers to work with the United States and Europe. But, in order to maintain the fiction that Mogadishu is a success (even though a half billion dollars each year buys the Somali government control over just a few square blocks in the center of Mogadishu) the U.S. government dissuades American companies from signing separate contracts with authorities in Hargeisa, the Somaliland seat of government.

After all, if the U.S. government does not recognize Somaliland’s legal right to issue contracts, then any American businesses operating in Somaliland are illegally infringing on Somali sovereignty. Any American support for Somaliland, the State Department also insists, would also undermine efforts to stabilize Somalia. Perhaps that makes sense in a sterile State Department boardroom or in the U.S. Embassy in Mogadishu, but China has no such qualms, and may tighten its rare earth monopoly while American diplomats wring their hands. Adding insult to injury, of course, is that despite the billions of dollars it has received in American assistance over the last decade, the Somali government also awards contracts to the Chinese.

It’s one thing for U.S. diplomats to fight for principle, but to do so absent a sense of vital U.S. national interests or a sense of Horn of Africa realities is counterproductive. Despite all the Trump administration’s rhetoric of America first, both the U.S. embassy in Somalia and the broader U.S. State Department appear effectively to be putting China first.

Michael Rubin (@Mrubin1971) is a contributor to the Washington Examiner's Beltway Confidential blog. He is a resident scholar at the American Enterprise Institute and a former Pentagon official.