Following the 1661 Marriage Treaty between England and Portugal, Charles acquired the Mediterranean enclave of Tangier. As part of its new garrison he transferred his Irish regiments from Dunkirk. Farrell was involved in much of the early fighting with the surrounding Moorish forces, but later left and returned to Ireland.