The L&M Companion volume says:
"Sandwich arrived first to find [Tangier] besieged by Moorish troops under 'Abd Allāh al-Ghailān (known to the English as Guyland or Gayland) who had rebelled against the Emperor of Morocco and was in control of the region around Tangier."
John Wreglesworth's essay on the English occupation of Tangier
"The English were fortunate in taking possession of Tangier at a time of political upheaval in Morocco. The Sa'adian dynasty was coming to an end. The local ruler Abd Allah Ghailan was then involved in a war with the ruler of Sale. Brave, ambitious and unscrupulous, Ghailan was to remain an implacable enemy of the English until his death in 1673 -- even though ironically the fortunes of war obliged him to seek a temporary refuge in Tangier. In March 1662, despite protestations of friendship, Ghailan appeared before the city, with an army of around 5,000, and denied the English permission to collect fuel within nine miles of Tangier. The compliance of Lord Peterborough encouraged further demands. For the next twenty years there was continuous low-intensity warfare which, at times, flared into large-scale fighting. Ghailan could call up armies of over 17,000 men. They were formidable enemies who excelled in raids and ambushes but lacked skills in siege-warfare. Against this, the English garrison brought greater organisation and firepower. Whenever pressed by supply difficulties or other commitments, Ghailan simply made valueless offers of peace and moved off from Tangier with his army."