The Emirate of Granada was established in 1228, after the Almohad dynasty was defeated by the Christians at the Battle of Las Navas de Tolosa. The Almohad prince Idris had left Iberia to take the Almohad leadership, the ambitious Ibn al-Ahmar established the longest lasting Muslim dynasty on the Iberian peninsula - the Nasrids.
With the Reconquista in full swing after the conquest of Cordoba in 1236, the Nasrids aligned themselves with Ferdinand III of Castile, officially becoming a tributary state in 1238. The state officially became the Kingdom of Granada in 1238. The Nasrid emirs and kings were responsible for building most of the palaces in the Alhambra. The taifa became a vassal state of the Christian kingdom of Castile for the next 250 years. The Nasrid sultans and kings paid tribute to the Christian kings and cooperated with them in the battle against rebellious Muslims under Castilian rule.
Initially the kingdom of Granada linked the commercial routes from Europe with those of the Maghreb. The territory constantly shrank due to repeated Castilian invasions, however, and by 1492, Granada controlled only a small territory on the Mediterranean coast. Arabic was the official language, and was the mother tongue of the majority of the population.
Granada was held as a vassal to Castile for many decades, and provided trade links with the Muslim world, particularly the gold trade with the sub-saharan areas south of Africa. The Nasrids also provided troops for Castile while the kingdom was also a source of mercenary fighters from North Africa. However, Portugal discovered direct African trade routes by sailing around the coast of West Africa. Thus Granada became less and less important for Castile and with the unification of Castile and Aragon in 1479, those kingdoms set their sights on conquering Granada and Navarre.
On January 2, 1492, the last Muslim leader, Muhammad XII, known as Boabdil to the Spanish, surrendered complete control of Granada, to Ferdinand and Isabella, Los Reyes Católicos ("The Catholic Monarchs"), after the city was besieged.
See Nasrid dynasty for a full list of the Nasrid rulers of Granada. The most prominent members of the dynasty were: