The siege of Algeciras was undertaken by the Castillian forces of Alfonso XI assisted by the fleets of the Kingdom of Aragon and the Republic of Genoa. The city was the capital and the main port of the European territory of the Marinid Empire. The siege lasted for twenty one months. The population of the city, about 30,000 people including civilians and Berber soldiers, suffered from a land and sea blockade that prevented the entry of food into the city. The Emirate of Granada sent an army to relieve the city, but it was defeated beside the Río Palmones. Following this, on 26 March 1344 the city surrendered and was incorporated into the Crown of Castile. This was one of the first military engagements in Europe where gunpowder was used.