A maritime official says German forces have rescued an Egyptian ship from a pirate attack in the Gulf of Aden .