The taxpayer is spending more than £15m a year to send the children of British diplomats and military officers to private schools such as Fettes, Winchester, Roedean and Marlborough.

The subsidies – costing as much as £30,000 a year in school fees – are being paid by the Foreign Office even when the diplomats have returned to the UK and then stay on for years.

The extraordinary hidden privilege has been unearthed by Gloria de Piero, a new Labour MP, in written questions. In a co-ordinated response, the Foreign Office and the Department for International Development said the perk was necessary to "recruit, motivate and retain staff who are skilled and equipped to meet the department's objectives".

It is understood the same privilege is provided to senior members of the military, but no figures have been divulged by the Ministry of Defence.

The Foreign Office refused to disclose the identity of the private schools, but the DfID agreed to do so. It disclosed that, in 2009-10, 339 officers received "continuity of education allowance" for 521 children – representing around 6% of staff employed at the Foreign Office.

FCO staff serving in the UK were paid £7,487,435 to cover school fees, with staff serving at posts overseas receiving £5,843,415. Under FCO rules staff based in the UK for between two and four years can have their children's school fees paid but after four years must meet the cost themselves or switch to state education.

DfID reported that, in the financial year 2009-10, 48 members of its staff on overseas postings received an education allowance at a total cost of £1,318,810.

The Foreign Office minister, Alistair Burt, defended the practice, saying the department "helps staff meet their potentially conflicting obligations by providing financial support for their children's education in the UK where staff choose this, or are obliged to do so given local conditions in the country to which they are posted".

He added: "In some countries, we do not permit staff to take their children either for health or security reasons. In others, local schools of an acceptable standard are not available."

Andrew Mitchell, the international development secretary, said: "Those with children have a legal obligation as parents to ensure that their children receive a full-time education from the age of five, and they pay UK tax wherever they work.

"Most parents prefer to take their children with them, but in some countries they are not permitted to do so, either for health or security reasons."

He said staff should be allowed to keep their children in private schools at taxpayers' expense because continuity of education, particularly at secondary level, was an important factor.

De Piero said: "Expecting the taxpayer to pay the public school fees for the children of civil servants who are based in the UK is simply a luxury we cannot afford.

"At a time when the coalition's cuts are threatening the education of the many, there can be no justification for this huge subsidy for the few.

"In this age of austerity, when public services are being cut, it cannot be right that we continue to spend these huge sums on private education. Ministers must urgently look at how to reduce this bill."