Interior minister Abba Moro told reporters in the northern city of Kano yesterday most of the deportees came from the neighbouring nations of Chad, Cameroon and Niger and were not properly documented.
He said Nigeria was engaging in the crackdown because illegal immigrants "have become ready tools in the hands of insurgents".
"So far as at today, over 22,000 of such illegal immigrants have been eased out of the country," he said in response to a question on activity in recent months with a state of emergency in place in the country's northeast.
Nigeria has at times sought to portray the insurgency by Islamist extremist group Boko Haram as being influenced and contributed to by foreigners.
More From This Section
However, most analysts see it as a domestic group fed by poverty and hopelessness in the country's north.
Nigeria is Africa's most populous nation with 160 million people, roughly divided between a mainly Muslim north and predominately Christian south.
The insurgency concentrated in the northeast has left more than 3,600 people dead since 2009, including killings by the security forces.