MALABO, Equatorial Guinea — While the United States has turned its back on some authoritarian rulers in North Africa and the Middle East, its attitude toward strategically placed autocrats in less restive corners of Africa is more ambiguous, and perhaps nowhere more so than in this oil-rich speck of a nation in the Gulf of Guinea.

Officially and unofficially, Americans do business with one of the undisputed human rights global bad boys, Equatorial Guinea, Africa’s fourth biggest oil exporter. Its widely criticized record on basic freedoms has offered little barrier to broad engagement by the United States, commercially or diplomatically.

American oil companies have billions of dollars invested here. One American diplomat, using language that makes human rights advocates fume, praised the “mellowing, benign leadership” of the dictator in power for more than 30 years, Teodoro Obiang Nguema Mbasogo, in 2009 cables released by WikiLeaks. And a leading American military contractor with strong Pentagon ties has a multimillion-dollar contract to protect his shores and help train his forces.

The contractor, Military Professional Resources Inc., or M.P.R.I., led by a top aide to former Defense Secretary Donald H. Rumsfeld, works on maritime security and human rights training for Mr. Obiang’s police forces. But even with the training, the United Nations, human rights groups and local dissidents say torture by the nation’s authorities remains systematic. And maritime security touches on the most sensitive aspects of personal defense for Mr. Obiang, especially in an island capital where coup attempts have come from the sea.