Sunan an-Nasa'i, Book 5, Hadith 41 (Nasa'i 490)

It was narrated that Al-Bara' said:

"We prayed toward Bait Al-Maqdis (Jerusalem) with the Messenger of Allah (ﷺ) for sixteen or seventeen months - Safwan was not sure - then it was changed to the Qiblah."