Sunan an-Nasa'i #4166
The Book of al-Bay'ah 39:18
It was narrated that Jabir bin Zaid said:
"Ibn 'Abbas said:'The Messenger of Allah (ﷺ), Abu Bakr and 'Umar were among the Muhajirin (emigrants), because they forsook (hajaru) the idolators, andsome of the Ansar were Muhajirun because Al-Madinah was a land of shirk, and they came to the Messenger of Allah (ﷺ) on the Night of Al-'Aqabah."'