Image copyright EPA Image caption Amnesty International reports continued detention and mistreatment of people in migrant centres
Pope Francis has compared detention centres in Libya to “concentration camps”.
The Pope, speaking in Libya on Sunday at the start of a six-day visit, also called for the Libyan crisis to be resolved through a political deal.
The comments come ahead of a Nato-sponsored regional summit in Lisbon later on Sunday.
Italy has been sending thousands of migrants back to Libya since the overthrow of dictator Muammar Gaddafi in 2011.
The situation on the ground continues to deteriorate, with reports of people being held in inhuman conditions in detention centres in Tripoli and Misrata, the BBC’s John Sudworth in Tripoli says.
Italy and the US accuse Libya of refusing to cooperate in preventing the smuggling of migrants.
In a press conference in Tripoli on Sunday, Pope Francis said: “You people who, when this tragedy happened, brought it to the world and tried to identify the killers and the victims, and said: ‘Yes, we are men of God.’
“I would say that for people of God, the question of migrants is a question of God’s gift. And in the same way God gave us the Jews who chose not to flee, he gave us the Christians who followed the example of the prophet Jesus when he was with a common Arab.
“In the same way he gave us the African people who flee from the deserts, who flee from violent and unjust regimes. He gave us these people. And he said ‘Come’,” our correspondent quotes the Pope as saying.
“They must not ask us to help them through the corridor of an open door or a closed door.”
He added: “There should be a political solution, and they must not be left to be victims of conflict or lost in the fault line of a political solution.
“They must be given a chance to feed themselves, to live, to rest, to pray, to work, to dream.”
A small group of migrants had gathered outside St Mark’s Square when the Pope was speaking, our correspondent adds.
Pope Francis is due to return to Rome on Tuesday morning.
The pontiff’s plane arrived in the Libyan capital after making an emergency landing at Tripoli airport on Saturday night, after militants attacked the coastal city of Zuwara, 120km (75 miles) west of the capital.
Five attackers were killed by a sniper in the town, but about 20 people were also killed and nearly 50 injured, including up to 20 children, AFP news agency quoted the Zuwara hospital director as saying.
The security operation in Zuwara, which caused by a rocket attack, comes weeks after a car bomb targeted Pope Francis in the Libyan capital, where he was en route to cross the Mediterranean to Europe.
The Pope’s visit to the country is expected to be the longest trip ever made by a Pontiff to Africa.