Charlemagne and the collection of warring pagan tribes into the Holy Roman Empire, Charles Martel, and the Battle of Lepanto all happened before the Modern Age and were all pivotal in holding off Islam.
The battle of Lepanto was in 1571. It was won in large part, because Europe was developing modernity. The Protestant reformation was well underway. The cannon mounted on the Christian ships made a huge difference in the outcome. The wealth being generated by the New World exploration was a large factor.
I would say 1571 is well into the early modern period.