The Prime Minister said the UK should look at the "economic advantages and disadvantages" of an amnesty for undocumented migrants.
Labour's Rupa Huq (Ealing Central and Acton) asked Mr Johnson if he was a "man of his word" after he "courted popularity with pledging an amnesty for illegal immigrants" as London mayor.
READ MORE: Ian Blackford brands Boris Johnson 'last Prime Minister of UK' in fiery Commons clash
Mr Johnson replied: "It is absolutely true that I have raised it several times since I was in Government.
"I must say it didn't receive an overwhelming endorsement from the previous prime minister when I put it to her when I raised it once in Cabinet.
READ MORE: Boris Johnson tells new Cabinet 'no ifs, no buts', Brexit by Halloween
"But I have to say I do think that our arrangements in theoretically being committed to the expulsion of perhaps half-a-million people who don't have the correct papers and who may have been living and working here for many, many years without being involved in any criminal activity at all ... I think that the legal position is anomalous and we saw the difficulties that kind of problem occasioned in the Windrush fiasco."
He continued: "We know the difficulties that can be caused and I do think - yes, I will answer her directly - I do think we need to look at our arrangements for people who have lived and worked here for a long time unable to enter the economy, unable to participate properly or pay taxes without documents.
"We should look at it and the truth is, the law already basically allows them an effective amnesty, that's basically where we have settled now.
"But we should look at the economic advantages and disadvantages of going ahead with the policy that she described, and which I think she and I share."