Surprisingly enough, the first (unofficial) US naval academy was in Morocco. US sailors were trained there.
Morocco was the first nation to officially recognize the new United States. I don't know the details of how our Navy got there, but we were shown the site of the training during our trip to Morocco.