Letters seen by the BBC reportedly show the Home Office suggested schools could withdraw children”s places if their families were found to be in the country illegally.
The proposal was strongly resisted by the then education secretary Nicky Morgan and was dropped from the Immigration Bill – reportedly to the fury of Mrs May who was home secretary at the time.
The dispute between the two ministers arose during the summer of 2015, with Ms Morgan writing twice to David Cameron to express her “profound concerns” about the Home Office plan for schools.
She wrote: “I have concerns about the practical and presentational issues of applying our strong position on illegal migrants to the emotive issue of children”s education.
“These cover deprioritising illegal migrants in the schools admissions process, and carrying out immigration checks through schools.”
Ms Morgan warned it could “destabilise” the school admissions process while adding to the problems of segregation and radicalisation.
She wrote: “The overall effect of a deprioritisation measure would be to concentrate children of illegal migrants in the least popular schools in any area, jeopardising our increasingly important focus on tackling both segregation and extremism, and with consequent impacts on the children of British nationals who attend the schools.
“Aside from the impact on ordinary parents, there is also a risk to children”s safety.
“Introducing these checks could lead to some children not being registered for school because of real or perceived fear of deportation.
“Leaving aside the fact that these young people will not receive a decent education, this is a safeguarding risk – we have real concerns that children out of school may be at greater risk of radicalisation or other harms.”
She also said the plan “would reinforce negative stereotypes of our party… squandering the unprecedented opportunity to capture the centre ground, that the election of Jeremy Corbyn has given us”.
Ms Morgan may have paid the price for her opposition to the scheme as she was sacked by Mrs May when she became Prime Minister in July.
Shadow education secretary Angela Rayner condemned the plan, saying it was evidence that Mrs May had been trying to “offload” the failure of the Home Office to cut immigration by making teachers take on border control functions.
She told the BBC Radio 4 Today programme: “It shows that actually Theresa May was not just considering it, her department was pushing it, and I”m deeply concerned about it.
“I think it”s a terrible idea. Denying innocent children because of the circumstances of their parents the right to a good education is disgusting, it”s not a British value that we have.”
A Government spokesman said they did not comment on leaked document, but added: “It is only right that any government looks at a range of options when considering policy options, but ultimately it is for ministers to decide which policies are taken forward.
“We are building a system that works in the best interests of the British people and ensures that only those with a right to be in the UK can live and work here.”