Madina is the second holiest city of Islam , after Mecca ( Makkah ) . Medina is celebrated for containing the mosque of Muhammad and also as the city which gave refuge to him and his followers , and so ranks as the second holiest city of Islam , after Mecca ( Makkah ) .