Midlothian education chiefs had urged councillors to consider scrapping the “informal agreement” to take pupils from Loretto RC Primary School in Musselburgh or set up a new deal, after they said they could not find any evidence of a formal cross-county agreement.

But a meeting of Midlothian Council on Tuesday heard a plea from the parent council of St David’s RC High School in Dalkeith to carry on the tradition, as they said that the Loretto students were part of the community and insisted that Catholic secondary schools cast a “wider net” when it came to catchment areas.

And Councillor Ellen Scott, the council administration’s education spokesperson,  warned that removing Loretto pupils from the St David’s roll could put its very future at stake, as one in eight of its students came from the Musselburgh primary.

Councillors heard that, prior to the abolition of Lothian Regional Council and the setting up of new local authorities, Loretto RC had been considered part of St David’s catchment and that had continued for decades without challenge.

But a review of school admissions policy across Midlothian raised concerns about the practice and asked for views on whether it should continue.

The Midlothian Council meeting heard from the parent council at St David’s that, despite the consultation results not being put to members for a decision, transitional visits by P6 and P7 pupils from Loretto had already been stopped on the order of Midlothian Council.

Ian Thom, representing the families, said that meant children from Loretto who made up part of this year’s new S1 missed out on vital visits to meet their new teachers and get to know the school, adding that these were also children who had missed out on years of early class experiences because of the Covid-19 pandemic.

East Lothian Council has confirmed that transition visits have not restarted for the current crop of P7 pupils preparing to transition to St David’s next summer from Loretto so far this year.

It is estimated that between 20 to 30 pupils from Loretto transition to St David’s every year, with more than 100 of the 759 pupils on the current St David’s roll coming from the Musselburgh school.

The school has a capacity of 890 pupils and Ms Scott said that the 80-year tradition of taking Loretto pupils had established a “moral obligation” to continue admitting them.

However, Councillor David Virgo questioned what would happen if growing populations led to the school reaching capacity and Midlothian pupils missing out on a place because Loretto was closer, even though it was in East Lothian.

He told the meeting: “Our priority has to be Midlothian children, I was not elected to represent East Lothian children or the Catholic Church.”

Ms Scott moved a motion that the council retain the status quo and continue accepting Loretto pupils, arguing that the fact the practice had gone on for generations established it was within the school’s catchment area.

But Alan Turpie, the local authority’s legal advisor, strongly urged members to agree to hold a new consultation to formally place Loretto in St David’s catchment, warning they left themselves open to a legal challenge without it.

After a break in which elected members held cross-party discussions, they returned with a motion led by Councillor Kelly Drummond to carry on the current arrangements with Loretto as part of St David’s catchment, subject to a formal consultation and new agreement with East Lothian Council being put in place.

They also agreed to hold talks with East Lothian Council to recoup costs of educating pupils at their secondary school.

Ms Scott said: “I think it is important that we get this right and I think the parents and pupils of Loretto RC and St David’s will understand the strength of feeling we have in this matter and bear with the process for a little longer.”

A spokesperson for East Lothian Council said: “We are aware of the discussions that took place at Midlothian Council in relation to school admission policy consultation for Loretto children attending St David’s RC High School.

“We look forward to a productive discussion with Midlothian colleagues to find a mutually agreeable way forward to the points from the meeting.”