During a drill, the vessel is chased by Somali pirates in two skiffs; Phillips succeeds in outrunning them when one gives up after hearing Phillips on the radio calling for immediate military air support (a bluff) and the other loses engine power while trying to gain speed under the rough water Captain Phillips created. The next day one of the skiffs returns with four heavily armed pirates led by Abduwali Muse (Barkhad Abdi); they are carrying a ladder they had hastily welded the night before. Despite the best efforts of Phillips and his crew, the pirates board and take control of the Maersk Alabama, capturing Captain Phillips after he cuts the ship's engine power and tells the crew to hide in the ship's engine room. Phillips offers Muse the contents of the ship's safe ($30,000), but under orders from his boss (the local Somali faction leader) Muse's plan is to ransom the ship and crew in exchange for millions of dollars of insurance money from the shipping company.
A crew member manages to cut the ship's emergency power, plunging the lower decks into darkness. As Muse, the pirate captain, attempts to search the engine room, the crew members overpower him. Negotiating with the other three pirates, one with badly injured feet, the crewmen arrange to trade Phillips for Muse and the ship's lifeboat. The pirates force Phillips onto the lifeboat and launch it, intending to hold the captain for ransom.
As the lifeboat heads for the shore, tensions flare between the pirates as they run low on the stimulant herb khat, lose contact with their mother ship, and are later intercepted by the U.S. Navy destroyer USS Bainbridge. Once additional U.S. Navy ships arrive, Phillips attempts to negotiate with Muse, who asserts that he has come too far and will not surrender. In the meantime, the Bainbridge's captain Frank Castellano (Yul Vazquez) is ordered to prevent the pirates from reaching the mainland by whatever means necessary.
That night, Phillips is able to escape and swims towards the ships. The navy cannot identify the swimmer as Phillips, and therefore they take no action. The pirates fire shots at him; he swims back to the lifeboat. The further agitated pirates are also unaware that a SEAL team has parachuted in to intervene.
While three SEAL marksmen get into positions to fire a simultaneous shot at each of the pirates on the lifeboat, Castellano and the SEALs continue to try to negotiate with the pirates, eventually taking the lifeboat under tow. Eventually, Muse agrees to board the Bainbridge, believing he will join his clan elders in negotiating Phillips's ransom. In the lifeboat, one of the more agitated pirates, Najee, catches Phillips writing a goodbye note to his wife. When he tries to take the note away, Phillips attacks Najee, but is quickly restrained and beaten.
Najee decides to take full control; the pirates tie Phillips up and blindfold him, and the Bainbridge crew stops the tow. As Phillips is about to be executed, the three SEAL marksmen finally get three clear shots and simultaneously kill the pirates. On board the Bainbridge, Muse is taken into custody and arrested for piracy. Phillips is rescued and treated. He is in shock and disoriented, but he thanks the rescue team for saving his life.