In September 1571 Cervantes sailed on board the Marquesa , part of the galley fleet of the Holy League , Spain , the Republic of Venice , the Republic of Genoa , the Duchy of Savoy , the Knights Hospitaller based in Malta , and others , under the command of King Philip II 's illegitimate half brother , John of Austria ) that defeated the Ottoman fleet on October 7 in the Gulf of Lepanto near Corinth , at great cost to both sides . In September 1571 Cervantes sailed on board the Marquesa , part of the galley fleet of the Holy League ( a coalition of the Pope , Spain , the Republic of Venice , the Republic of Genoa , the Duchy of Savoy , the Knights Hospitaller based in Malta , and others , under the command of King Philip II 's illegitimate half brother , John of Austria ) that defeated the Ottoman fleet on October 7 in the Gulf of Lepanto near Corinth , at great cost to both sides .