Nigeria's president said on Wednesday the government had started bringing stranded citizens home from Libya after a global outcry over reports that migrants there were being sold into slavery.
Muhammadu Buhari's comments came days after CNN aired footage that appeared to show men being auctioned as farm hands in Libya after being smuggled across the Sahara.
Libya's U.N.-backed government has said it is investigating.
"The situation in Libya, of people being sold into slavery, is appalling and unacceptable. We will do everything to protect our citizens wherever they might be," Buhari wrote on his Twitter account.
Nigeria had "started bringing back home all Nigerians stranded in Libya and elsewhere," he added.
The U.N.'s International Organization for Migration said 239 Nigerians flew home from Tripoli on Tuesday.
It has said Nigerian migrants risk exploitation, detention and abuse as they head north to Libya, hoping to cross the Mediterranean to Europe.