CAMP LEMONNIER, Djibouti — Commercial ships must once again shore up their defenses against forced boardings at sea, United States Defense Department officials said on Sunday, warning that Somali pirates are returning to waters off East Africa after five years of calm.

Defense Secretary Jim Mattis said that while he was not calling for a response yet from the United States Navy, a half-dozen pirate attacks on commercial ships off the coast of Somalia in the past eight weeks meant that civilian mariners and shipping companies must again be on high alert.

American military commanders at the Pentagon’s sole semipermanent base in Africa, Camp Lemonnier in neighboring Djibouti, have been monitoring the attacks.

Gen. Thomas D. Waldhauser, the head of the United States Africa Command, said drought and famine in Somalia are probably behind the recent spike in attacks, in which pirates have boarded commercial ships and seized food and oil.