The ships have stopped several pirate attacks , most recently on Tuesday , when the crew of a German frigate arrested nine pirates who had fired on a cargo ship .