In the sixth month of 1st Hijri, the Prophet (s.a.w.a.) visited the tribe of Bani Saalim which is in the north-west of Medina on invitation by Umme Bashar. As usual, he prayed two units of Zohr prayer facing Bayt-ul-Muqaddas when Allah ordered him to face Kaba. He continued the remaining prayer facing Kaba. After that, Kaba became Qiblah of Muslims forever. Hence this mosque is called 'Masjid-e-D'uqiblatan' or 'Masjid-e-Qiblatain' (The Mosque of Two Qiblas). This mosque is a little away from Mosque of Fatah towards the west.
This is a verse among the verses revealed on this incident.
Earlier there were two arches (Mehrab) opposite to each other - one facing Kaaba and another Bayt-ul-Muqaddas. Unfortunately, only one arch remained when the renovation of this mosque was done a few years ago. The first signs of this incident were erased.