Former President Barack Obama has compared the treatment of modern immigrants to that which the Irish who fled to America during the Great Famine had to endure.

Speaking to 400 students at the University of Chicago, where he once taught constitutional law, the retired statesman said America’s immigration policy was “‘driven by biases” like it was in the 19th century at height of the Famine.

When asked about the new administration’s efforts to tighten controls on immigration Obama mused, “I always used to say in crowds where folks didn’t want to hear it, 'It’s not like everyone in Ellis island had their papers straight.'

Irish immigrants arriving through the doors at Ellis Island.

Irish immigrants arriving through the doors at Ellis Island.

“The truth is the history of our immigration system has always been a little bit haphazard, a little bit loose, a little bit determined by did the country want more workers, economic imperatives, sometimes it was driven by biases.

“If you look at what was said about [the] Irish when they were coming here in the wake of the potato famine they talked about them the same way you hear people talking about immigrants today.

“This is an example of where everybody being able to see the realities of immigrants as people, not as as some ‘other’ is important.”

Between 1845 and 1855 an estimated one and half million Irish men, women and children fled to the United States. Many came in 'coffin ships' that had a 30% mortality rate; dead bodies were buried at sea and sharks followed the ships across the Atlantic because they were such a reliable a source of food.

Once in America, the Irish frequently faced anti-Catholic prejudice and economic hardship.

Since leaving office the Obama family has remained in Washington DC while their younger daughter finishes school. He told the crowd, however, that he will remain active in politics.

“The single most important thing I can do is to help in any way I can to prepare the next generation of leadership to take up the baton,” he said.

Read more: Fighting for a sacred resting place for thousands of Famine dead on Staten Island

Former president Barack Obama spoke about the Irish immigrants during his first public appearance after his presidency.