Navy Seal snipers rescued an American cargo ship captain unharmed and killed three Somali pirates in a daring operation in the Indian Ocean on Sunday, ending a five-day standoff between United States naval forces and a small band of brigands in a covered orange lifeboat off the Horn of Africa.