El-Ksar el-Kebir (; ), originally known as Kasr el Rif, is a city in northwestern Morocco, about 160 km north of Rabat, 32 km east of Larache and 110 km south of Tangier. It recorded a population of 126,617 in the 2014 Moroccan census.

The city is also known as Alcazarquivir in Spanish or Alcácer-Quibir in Portuguese. The name means "the big castle".
The city is located nearby the Loukous river, making El-Ksar-el-Kebir one of Morocco's richest agricultural regions. El-Ksar el-Kebir provides almost 20% of the needed sugar of Morocco.
Neighbouring cities and towns include Larache, Chefchaouen, Arbawa and Tateft.

History
1st millennium BCE: Established as a Carthaginian colony; after the Punic Wars it came under Roman control with the name Oppidum Novum.

In 1578, King Sebastian of Portugal suffered a crushing defeat in the Battle of Alcácer Quibir at the hands of the King Abd al-Malik of Morocco, which ended Portugal's ambitions to invade and Christianize the Maghreb. Both kings died during the battle, as did Abdallah Mohammed, who was allied with Sebastian. The death of King Sebastian started the events which led to the temporary union of the crowns of Portugal and Spain under Philip II of Spain. King Abd al-Malik's victory gave Morocco substantial strength and international prestige.

The city experienced a substantial growth with the settling of an important Spanish garrison in 1911 as a part of the Spanish Morocco Protectorate in Morocco. After Morocco's independence and the building of the Oued el Makhazine reservoir by King Hassan II to manage the Loukkos' river regime, the city became an important regional agricultural distribution center.

12th century: City walls are built by the command of the Abu Yusuf Yaqub al-Mansur, according to Leo Africanus.
1578: The Battle of the Three Kings is fought at the location of Ksar el-Kebir.
17th century: Sultan Moulay Ismail destroys the city walls of Ksar el-Kebir, after being angered by a local chief.
1911: Spain conquers Northern Morocco, and the town is rebuilt, and given a Spanish name, Alcazarquivir.
1956: With Morocco's independence, Alcazarquivir is transferred from Spanish control, and renamed Ksar el-Kebir.

Culture
El-Ksar el-Kebir is reputed for the leading artists, writers, poets and sportsmen on national plane.
In sports, football player Abdeslam Laghrissi still keeps his record as the best marksman in the Moroccan championship with 26 goals in 1986.
In music, Abdessalam Amer (died 1979) who is well known in the Arab world as a unique music composer. He left such eternal songs as: Red Moon, Beach, Leaving, The Last Oh!.
In poetry, Mohamed El Khammar El Guennouni (died 1991) was a pioneer in modern Moroccan poetry and is regarded as master of free poetry in Morocco. There is also poet Ouafae El Amrani in the new poetic generation.
In novel-writing, there are such novelists as Mohamed Aslim, Mohamed Harradi, Mohamed Tetouani, Mohamed Sibari and Moustafa Jebari.
In short-story writing, there is Mohamed Said Raihani, who is a trilingual writer (he writes in Arabic, French and English) and who has finished his fortieth manuscript before reaching the age of forty.
Education there is Mohammadia high school

Notable people 
 Hamid El Kasri, Gnawa music singer
 Abdeslam Laghrissi, professional footballer
 Achraf Hakimi, professional footballer
 Yehuda Benasouli, former Chief Rabbi of Madrid, Spain

Twin towns
 Lagos, Portugal

References

Cities in Morocco
Former Portuguese colonies
Kingdom of the Algarve
Ksars
Populated places in Larache Province
Populated places established in the 1st millennium BC
Roman towns and cities in Morocco
Morocco geography articles needing translation from French Wikipedia