In 715, the city was conquered by the Moors under Tariq ibn-Ziyad who called it Yaburah during the Moorish rule (715–1165), the town, part of the Taifa of Badajoz, slowly began to prosper again and developed into an agricultural centre with a fortress and a mosque. Évora was wrested from the Moors through a surprise attack by Gerald the Fearless (Geraldo Sem Pavor) in September 1165. The town came under the rule of the Portuguese king Afonso I in 1166. It then flourished as one of the most dynamic cities in the Kingdom of Portugal during the Middle Ages, especially in the 15th century.The present character of the city is evidence of the Moorish influence.