The Hershel “Woody” Williams, a massive warship the U.S. Navy calls an “expeditionary sea base,” is now off the west coast of Africa as part of a multinational exercise in countering piracy. Nearly 800 feet long and topped with a flight deck for helicopters, the Williams can provide tremendous logistical support — fuel, stores, spare parts — while remaining at sea almost indefinitely, because it has two separate crews that exchange places every four months.

Deploying the mobile base makes an important statement of U.S. commitment in Africa. And, given the scourge of African piracy, it makes strategic sense as well.

The Gulf of Guinea, which contains important shipping lanes for Europe and vast oil reserves, urgently needs multinational counterpiracy operations. Last year, there were 46 successful and attempted piracy incidents in the waters off Nigeria and Benin alone — roughly a quarter of the world’s attacks, according to the International Maritime Bureau’s global piracy reporting center. The United Nations estimates that West Africa loses more than $750 million a year due to maritime crime

When I was commander of NATO’s armed forces in 2009, we began a large-scale counterpiracy mission off Somalia, Operation Ocean Shield. We all but ended that threat off East Africa, but it has shifted across the continent. And while Somali pirates, made infamous by the movie “Captain Phillips,” carried out a small number of audacious assaults on large ships, the problem in the Gulf of Guinea is more complicated and widespread.

Most attacks take place close to shore, with bulk carriers, container ships and small tankers carrying refined petroleum products the main targets. Other attacks involve taking hostages from boats ferrying workers to offshore oil-drilling platforms. The captives are taken to the swampy jungles on the coast and held until their employers pay ransom. (In some cases, there is cooperation from the crewmembers and supposed hostages themselves, who receive a cut after the oil companies pay up.)

The current exercise, Operation Guinex, will run until the end of September. It is led by the U.S. Africa Command and brings together navies from both sides of the Atlantic, including 10 African nations. Brazil has deployed a powerful frigate, the Independencia, and the Nigerian navy, the dominant maritime force in the region, has a half-dozen ships involved. In addition to naval maneuvers, there is an emphasis on training local special forces, along the lines of the U.S. Navy SEALs.

Building a collective sea-based force with regional partners is an approach the U.S. has used in Latin America and the Caribbean for decades, enhancing security without the expense and political challenges of a heavy logistical footprint.

Operation Guinex also aims to improve interoperability between U.S. naval platforms and local partners — including point-to-point secure radio transmissions; data links with tracking information on commercial shipping; and access to unclassified satellite feeds. Better intelligence-sharing can provide tactically useful information to the African militaries and help the U.S. gain insight into terrorist threats. (There are unconfirmed reports that some of the pirates’ haul has made its way to the terrorist group Boko Haram, which has sworn allegiance to the so-called Islamic State.)

The Navy should build on the deployment of the Williams by increasing its routine port visits to the Gulf of Guinea. These need not be high-tech Arleigh Burke destroyers or Ticonderoga cruisers; humbler U.S. Coast Guard vessels are a better match to the capabilities of the local navies. The Navy’s Spearhead class of expeditionary fast transports, essentially smaller versions of the Williams, would also be good choice, as would amphibious vessels with their shallower drafts.

Ideally, cooperation with the Gulf of Guinea nations will become an all-of-government operation, bringing teams from the Drug Enforcement Agency, the State Department’s Bureau of International Narcotics and Law Enforcement, the Federal Bureau of Investigation, the Department of Homeland Security and the National Oceanic and Atmospheric Administration. As the North Atlantic Treaty Alliance learned a decade ago in Somalia, defeating piracy can’t be done at sea alone — the scourge is driven by dire conditions onshore.

For the U.S., improving military, law-enforcement and diplomatic ties in Africa will be increasingly vital — especially as Chinese political outreach and (often predatory) investment grows.

There is reason to be optimistic. African nations have traditionally been wary of allowing a permanent U.S. military presence, such as providing home ports for Navy ships. This spring, however, the Nigerian government surprisingly urged the Pentagon to move the U.S. Africa Command headquarters from Hamburg, Germany, to a location on the continent.

Africa’s population could reach 2.5 billion by mid-century, a quarter of the world’s people. Extreme poverty, drought, poor infrastructure, religious disagreements and intrusive outside powers create conditions in which civil conflict, piracy and terrorism flourish. The government of Guinea was overthrown in a military coup just days ago.

The Williams is doing more than fighting the modern-day buccaneers: It is showing that the U.S. has a stake in maintaining stability and security in the world’s fastest-growing continent.

This column does not necessarily reflect the opinion of the editorial board or Bloomberg LP and its owners.

James Stavridis is a Bloomberg Opinion columnist. He is a retired U.S. Navy admiral and former supreme allied commander of NATO, and dean emeritus of the Fletcher School of Law and Diplomacy at Tufts University. He is also chair of the board of the Rockefeller Foundation and vice chairman of Global Affairs at the Carlyle Group. His latest book is “2034: A Novel of the Next World War.”

More stories like this are available on bloomberg.com/opinion

©2021 Bloomberg L.P.