The picture on the left is Masjidul Qiblatain (Mosque of the Two Qiblas).
Masjid Qiblatain (masjid of two Qiblas) is one of three most important masjids in Madinah built in early days after hijrah, along with Masjid Quba and Masjid Nabwi. Here was the great event of changing of Qibla happened in Rajjab 2 hijri.
During the early 13 years of prophethood spent in Makkah and the fir 16 months of stay in madina, Prophet صلى الله عليه وآله وسلم used to offer prayers facing towards Masjid Bait Al-Maqdas in Jerusalem. But since a long time Prophet صلى الله عليه وآله وسلم had a strong wish that Qibla for Muslims should be towards Ka'aba, Makkah.
This changing of qibla was an answer to the Jews, who used to say to Muslims especially after Migration, “Mohammad claims to have a religion whose laws supersede all other previous laws, yet he does not have an independent Qiblah, and offers his prayers facing the Qiblah of the Jews."
When this news reached Prophet Mohammad صلى الله عليه وآله وسلم he used to come out at night and waited for the revelation from Allah about this matter and the following verse was revealed at this time:
“Verily, We have seen the turning of your face towards the heaven. Surely, We shall turn you to a Qiblah (prayer direction) that shall please you, so turn your face in the direction of Al-Masjid Al-Haram (at Makkah). And wheresoever you people are, turn your faces (in prayer) in that direction.” [2:144]
So in the month of Rajjab 2nd hijri, after 16 months of migration when on day Prophet صلى الله عليه وآله وسلم was praying Duhur (at most places it is said asr prayer) with His companions, after 2 rakahs of the prayer, command came to Prophet صلى الله عليه وآله وسلم to turn towards Ka'aba in Makkah, Angel Jibrael communicated this command and held Prophet صلى الله عليه وآله وسلم hand and turned him in that direction.
At that moment Hazrat Ali رضي الله عنه and a few Muslims followed Prophet صلى الله عليه وآله وسلم and turned towards Ka'aba, the others were still confused.~
Jews were not happy on this change also some hypocrites reverted back to Judaism or paganism. Jews took as advantage and provoked them, some of the reverends went to Prophet صلى الله عليه وآله وسلم and asked to change the orientation to Jerusalem. They would accept Islam after the orientation is changed. At this time a revelation came:
“And even if you were to bring to the people of the Scripture (Jews and Christians) all the Ayat (proofs, evidence, verses, lessons, signs, revelations, etc.), they would not follow your Qiblah (prayer direction), nor are you going to follow their Qiblah (prayer direction). And they will not follow each other’s Qiblah (prayer direction). Verily, if you follow their desires after that which you have received of knowledge (from Allah), then indeed you will be one of the Zalimun (polytheists, wrong-doers). ” [2:145]Prophet of Allah, Muhammad صلى الله عليه وآله وسلم also said in this regards that: “The People of the Book do not envy us for anything as much as they do for the Friday given to us by Allah with which they are deprived. They also envy us for the Qibla which Allah gave us but not them, and also for the aameen (recital after Surah Fatiha in salat) behind the imam.”
Initially this Masjid had two mehrabs; one facing towards Jerusalem and the other facing towards Makkah. When Ottoman Empire took over, it was renovated and only the mehrab facing Makkah was left and the other one was demolished.