Abu `Abdallah Muhammed XII (Arabic: أبو عبد الله محمد الثاني عشر Abū ‘Abd Allāh Muḥammad al-thānī ‘ashar) (c. 1460 – c. 1533), known to the Castilians as Boabdil (a Spanish rendering of the name Abu Abdullah), was the twenty-second and last Nasrid ruler of Granada in Iberia.
Son of Abu l-Hasan Ali, sultan of the Emirate of Granada, Muhammad succeeded him in 1482.
Muhammad XII soon sought to gain prestige by invading Castile. He was taken prisoner at Lucena in 1483. Meanwhile, his father returned to power and then in 1485, his uncle Muhammed XIII, also known as Abdullah ez Zagal.
In 1491, Muhammad XII was summoned by Ferdinand and Isabella to surrender the city of Granada, which was besieged by the Castilians. Eventually, on 2 January 1492, Granada was surrendered.