Officials described the incident as an “act of international terrorism and piracy,” adding that all crewmembers were brought to safety.