Image copyright St Olave's school Image caption Head teacher Aydin Önaç has now resigned

The head of a grammar school at the centre of a row about pupils being forced to leave before their A-levels has resigned.

Aydin Önaç, headmaster of St Olave's Grammar School in Orpington, south-east London, will leave his post at Christmas, a letter to parents said.

Mr Önaç was suspended by the school's governing body last month.

Parents began legal action over the A-level exclusions but the school later backed down and let the pupils return.

St Olave's is one of England's top-performing grammar schools, with pupils selected on academic ability.

In September, a group of sixth-formers who did not get high enough grades at AS-level were told they would not be allowed to return to do their A-levels.

In the letter to parents, sent late on Friday afternoon, acting head Andrew Rees said the headmaster was departing for "personal reasons".

"He leaves, with great sadness, a school which is now regarded as one of the nation's most outstanding schools and one in which parents and pupils can have great pride and confidence.

"Mr Önaç would like to thank all those governors, staff, parents and students who have supported him over the last seven years and extends his very best wishes to them for the future."

Parent Andrew Gebbett, who has two sons at the school, expressed relief at Mr Önaç's decision to leave.

"The school can now move on," he said.

Image copyright PA Image caption St Olave's was at the centre of a controversy over pupils being removed from the school before A-levels

Debbie Hills, chair of the school's parents' association, who remained in post despite her son deciding to leave after being among those excluded, described the resignation as "a first step to it being put right".

"It's been a long fight."

The parents' association first sought Mr Önaç's resignation at a meeting in September.

Another parent in a similar position said: "There will be a lot of people who will be breaking open bottles of champagne tonight."

The parent, who asked not to be named, said it was appropriate that the school's motto was "'to right the wrong' - and that's what's been done".

Tony Wright-Jones, a parent and former governor of the school, said: "We want to know as parents and governors what exactly went on".

This year's A-level results at St Olave's saw 75% of all grades being awarded at A* or A and 96% were at A* to B grades, far above the national average.