In 1804, U.S. Navy Commodore Stephen Decatur battled the infamous Barbary pirates off the northern coast of that same continent. Those pirates were demanding tribute from American vessels, and Decatur's solution was to dispatch U.S. Marines to the shores of Tripoli.
Flash ahead to the Persian Gulf "tanker war" of 1987-88, when the Navy was called on to protect commercial shipping from attacks by Iran.
In that case, U.S. cruisers, destroyers and frigates were severely limited in what actions they could take against armed speedboats preying on unarmed oil tankers and container ships and sowing mines in Gulf shipping channels.
The Reagan administration then "reflagged" 11 Kuwait tankers with U.S. colors and provided naval escort to protect them from Iran's attacks.
The main lesson in that conflict was "finding a measured response - how to react to a belligerent with whom we are not at war
- without going to war," says retired Marine Gen. George Crist, who was then chief of U.S. Central Command, the post now held by Gen. David Petraeus.
It was Crist who decided the U.S. warships under his command were ill-equipped for close-quarters combat with small craft in what a U.S. officer called "a lake in a desert."
To resolve this problem, he had machine guns installed on destroyer decks and hired two large construction barges as floating "secret bases" for night-flying helicopters and Navy SEAL teams on call for special missions. Their presence ended Iran's attacks in the northern Gulf, Crist said.
But when the cruiser USS Vincennes mistakenly shot down an Iranian civilian jetliner, killing all 290 aboard, it demonstrated the limitations of high technology in a low-tech situation. The ship's radar had misidentified the A300 Airbus as an Iranian warplane in attack mode.
Like the Iranians, the Somalia-based pirates venture out in small speedboats
- either from shore or from "mother ships" - to hijack commercial vessels in the Arabian sea, take crew members hostage and demand huge ransoms.
The pirates, who recently stepped up their attacks, still hold 15 ships and dozens of hostages.
While Crist says an analogy between past events in the Gulf and today's piracy is imperfect, the principle of freedom of navigation applies in both.
"We have every right to protect our ships," Crist said from Beaufort, S.C., in a telephone interview. "We are not without the means. Why aren't they being employed?"