The Home Office under Theresa May wanted the children of illegal immigrants to be placed at the bottom of the list for school places, according to leaked Cabinet correspondence.
As well as suggesting schools could withdraw children's places if their families were found to be in the country illegally, letters seen by the BBC reportedly show the Home Office wanted schools to check passports before accepting new pupils.
The proposals were strongly resisted by the then education secretary Nicky Morgan and were 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.
"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," she wrote.
"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.
"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," she wrote.
"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 Ms May when she became prime minister in July.
Shadow education secretary Angela Rayner condemned the plan, saying it was evidence that Ms May had been trying to "offload" the failure of the Home Office to cut immigration by making teachers take on border control functions.
"I think it's a terrible idea,” she told the BBC Radio 4 Today programme.
“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."
Outgoing chief inspector of schools Sir Michael Wilshaw told the Today programme: "I'm amazed by (the story), shocked by it. Schools shouldn't be used for border control.
"That's the job of the border agencies, schools have got enough to do to raise standards than worry about who they are taking in and whether they've got a passport."