In 1627, an English invasion force commanded by the Duke of Buckingham(!) attacked the island in order to relieve the Siege of La Rochelle. After three months of fighting against the French under Marshal Toiras, the Duke was forced to withdraw in defeat. Vauban was engaged to strengthen the fortifications and the result is the walls which today surround the town, together with a stronger fortress that is now a prison. The fortress has it’s own small but well defended harbour - presumably to supply the garrisons posted there.
Today St-Martin-de-Ré is a holiday destination although entry is still defended: cars can’t enter the inner area unless they can pass the barrier. We had to park outside and negotiate the code from our hotel but I don’t think this aimed at keeping the English out!