Captain Phillips was taken hostage when the four pirates briefly hijacked the container ship Maersk Alabama in what is thought to be the first pirate seizure of a US merchant vessel since the North African Barbary Wars two centuries ago .