After completing his pilgrimage to Mecca, he died in Medina in 1871 while visiting the city, and was buried in the Jannatul Baqi, a historical graveyard in Medina where many prominent personalities from Islamic history are interred.