In Twelver Shia Islam, Abul Hasan Ali ibn Muhammad al-Samarri(939 AD) was the fourth and last of The Four Deputies appointed by the twelfth and final Imam, Muhammad al-Mahdi, while he was in the Minor Occultation. Unlike his predecessors he had no appointed successor, and the Major Occultation began after his death.
In the time of tenth and eleventh Imams of Shia, Ali al-Hadi and Hasan al-Askari He was a companion of them and was designated as the fourth and last of The Four Deputies for a period of 3 years after the death of the third deputy Abul Qasim Husayn ibn Ruh al-Nawbakhti. Six days before his death, he received a letter from the twelfth and final Imam, Muhammad al-Mahdi, in which he was notified that there would be no deputy after him.
The date of birth of Abul Hasan Ali ibn Muhammad al-Samarri is not known. al-Samarri called al-Sammari because was living in al-Sammar or al-Saymar, one of the areas of Basra. He was from a prominent Shia family of Basra. Many members of his family were the agents of previous Imams of Shia. Before Minor Occultation he was the deputy of Ali al-Hadi, the tenth Imam of Shia and Hasan al-Askari the eleventh Imam of Shia.
When Husayn ibn Ruh al-Nawbakhti, the third deputy, was about to die, he named al-Samari as the next and fourth deputy of twelfth Imam of Shia. Because of his family and his good record in the time of two previous Shia Imams amongst Shias, he faced no problem in his being accepted as the deputy by the Shia community. Due to unprecedented crackdown of Banu Abbas against Shias in the period of deputy of Muhammad al-Sammari, he wasn't very active and had intentionally limited his interaction with his agents amongst Shias.
On the sixth day after receiving the letter, Abul Hasan Ali ibn Muhammad al-Samarri died (939 AD) and he was buried in Baghdad near the current grave of Sheikh Kulayni. Before his death, they asked him about the next deputy and he responded: "I don't have permission to introduce anyone". Following his death, the Major Occultation began.