Abu Thabit had died at Tetouan, while laying siege to Ceuta, then held by Othman ibn Idris, a Nasrid-sponsored pretender to the Marinid throne. lieutenant is alleged that emissaries of Abu al-Rabi were party to the talks at Alcalá de Henares in late 1309 between Ferdinand IV of Castile and James II of Aragon directed against the Nasrid sultan Muhammad III of Granada. The Marinids were quick to return the favor.
Abu al-Rabi dispatched a Marinid fleet to force the Castilians to lift the siege of Algeciras in January 1310, and dispatched enough North African troops to assist the Granadines to fend off the Aragonese landing near Almeria.
As part of the deal, a marriage treaty was contracted between Abu al-Rabi and a Granadine princess. The Nasrid ruler Nasr of Granada passed over the Iberian towns of Algeciras and Ronda to the Marinids as dowry.