Muhammad XII soon sought to gain prestige by invading Castile. He was taken prisoner at Lucena in 1483.[2] Meanwhile, his father returned to power and then in 1485, his uncle Muhammed XIII, also known as Abdullah ez Zagal.

He only obtained his freedom and support to recover his throne in 1487 by consenting to hold Granada as a tributary kingdom under the Catholic monarchs[2] and not to intervene in the Siege of Málaga (1487), in which Málaga was taken by the Christians.

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.[2] In most sumptuous attire the royal procession moved from Santa Fe to a place a little more than a mile from Granada, where Ferdinand took up his position by the banks of the Genil. A private letter written by an eyewitness to the bishop of León only six days after the event recorded the scene:

The Moorish sultan with about eighty or a hundred on horseback very well dressed went forth to kiss the hand of their Highnesses. According to the final capitulation agreement both Isabel and Ferdinand will decline the offer and the key to Granada will pass into Spanish hands without Muhammad XII having to kiss the hands of Los Reyes, as the Spanish royal couple became known. The indomitable mother of Muhammad XII insisted on sparing her son this final humiliation.

After your Highnesses ended the war of the Moors who reigned in Europe, and finished the war of the great city of Granada, where this present year 1492 on the 2nd January I saw the royal banners of Your Highnesses planted by force of arms on the towers of the Alhambra.

Legend has it that as he went to exile, he reached a rocky prominence which gave a last view of the city. Muhammad XII reined in his horse and, viewing for the last time the Alhambra and the green valley that spread below. The place where this allegedly took place is today known as the Suspiro del Moro, the Moor's sigh. He grieved his loss and continued his journey to exile with his mother.

Shortly after his surrender, Muhammad Boabdil sent a long letter to the Marinid rulers of Morocco asking for refuge. The letter is long, extremely well written and begins with a long poem praising the Marinids, followed by a prose where he laments his defeat and asks forgiveness for past wrongdoings of his forefathers against the Marinids. The entire text was reported by al-Maqqari:[3]

...The lord of Castile has proposed for us a respectable residence and has given us assurances of safety to which he pledged by his own handwriting, enough to convince the souls. But we, as descendants of Banu al-Ahmar, didn't settle for this and our faith in God does not permit us to reside under the protection of disbelief.

We also received from the east many letters full of goodwill, inviting us to come to their lands and offering the best of advantages. But we cannot choose other than our home and the home of our forefathers, we can only accept the protection of our relatives, not because of opportunism but to confirm the brotherhood relationship between us and to fulfill the testament of our forefathers, that tells us not to seek any help other that of the Marinids and not to let anything obstruct us from going to you. So we traversed the vast lands and sailed the tumultuous sea and we hope that we would not be returned and that our eyes will be satisfied and our hurt and grievous souls will be healed from this great pain...[3]

17th-century Historian Al-Maqqari wrote that Muhammad XII crossed the Mediterranean to Melilla then went to Fes where he built a palace. He stayed there until his death in 1533/1534 (in 940 A.H.).[1][4] He was buried near the Musala (place of the special prayer during the Islamic festivals) located outside of "Bab Sheria" in Fes.[1] Muhammad XII was survived by two sons; Yusef and Ahmed.[1]Al-Maqqari met with his descendants in 1618 in Fes; they lived in a state of poverty and relied on the Zakat.[1]

Spanish chronicler Luis del Mármol Carvajal[5] wrote "Muhammad XII died near the Oued el Assouad (Black River) at ford told Waqûba during the war between the Marinids and the Saadians." This source is also taken by Louis de Chénier, a diplomat of the King of France Louis XVI, in his Historical research on the Moors and History of the Empire of Morocco published in Paris in 1787.[6]

Abu Abdallah appears as the main character in "De Ongelukkige" published in 1915 by Dutch author Louis Couperus. This novel covers the last decade of Abu Abdallah's reign as ruler of the Emirate of Granada.

He is part of the storyline for the video-game "Assassin's Creed II: Discovery" on the Nintendo DS.

Louis Aragon's book Le Fou d'Elsa renders a dramatized and poetic version of the story of Granada's capture, which includes Muhammad XII as one of the two main characters present in the novel, (Majnun being the other. Elsa, whom it could be argued is the second major character, is absent from the book.).

Also in 1980 (November 22 to February 7 of the following year), appeared in the comics supplement to the Portuguese newspaper A Capital a 12-page comics story on the conquest of Granada with Boabdil as the main character, Luz do Oriente ("Light of the Orient"). The script was by popular literature writer and bookman Jorge Magalhães and the drawing was by Portuguese-Guinean sculptor, painter and comic book artist Augusto Trigo.[7]