An East Renfrewshire secondary school has claimed the title of the best-performing state school in Scotland.

Full tables

Controversy over league tables

Eastenders with a high sense of achievement

St Ninian's High School in Giffnock topped The Herald's league tables with 47% of its pupils achieving five or more Highers this year.

Another East Renfrewshire school – Mearns Castle High, in Newton Mearns – came second, with 45% of its pupils achieving the benchmark.

For the first time in recent years, Glasgow's Jordanhill School, the country's only state-funded but independently run secondary, slipped to third in the rankings.

Jordanhill also had 45% of its pupils achieving the benchmark of five or more Highers in exams earlier this year but was placed third because it has a lower percentage of pupils on free school meals.

In the independent sector, Dollar Academy in Clackmannanshire came top of the larger private schools, with 84% of pupils achieving the benchmark.

The only school to outperform Dollar was the small St Mary's Music School in Edinburgh, where 89% of pupils got five or more Highers.

St Ninian's headteacher John Docherty welcomed the figures, which represent another significant achievement for the school.

He said: "I'm delighted for the pupils, parents and staff. At St Ninian's, it's a big team effort. Our pupils continue to work hard and we receive great support from the education service and the director of education."

Mr Docherty said a significant factor in St Ninian's exam success was rigorous tracking of pupil performance throughout the school year to ensure standards were being maintained.

"We have a consistent approach right across the authority and school to how we track the progress of pupils with the close involvement of parents," he said.

"We ensure that if there are any issues affecting how a pupil is performing, we can pick it up and put in place support to tackle the issue quickly."

Although those schools at the top of The Herald's league tables were rightly celebrating, it is important to put the information published in perspective.

While the table of the top 50 schools highlights those with the highest exam performance, it does not necessarily make them the best schools.

The difficulties inherent in exam league tables are well illustrated by the fortunes of Castlemilk High School, in one of the most economically deprived areas of Glasgow.

The school had none of its pupils achieving five or more Highers this year, but recently received six ratings of "excellent" out of 17 areas assessed by HM Inspectorate of Education, the former schools inspectorate.

The school also has significant proportions of its pupils going to "positive destinations" such as work, training and further and higher education despite the fact many are coping with difficult family circumstances such as drug abuse, alcoholism, unemployment and violence.

The fact such a school is being compared to those in the leafy suburbs where pupils have strong support from parents – and may also receive coaching from private tutors – can be deemed unfair. What is clear from the figures published yesterday on the Scottish Schools Online website is the impact of deprivation on exam success. As previous studies have shown, council areas in the most deprived parts of Scotland are largely outperformed by the wealthiest areas.

The lowest-performing local authority areas all have a much higher proportion of pupils on free school meals than the national average of 15.2%.

For example, Glasgow, the lowest-performing council area, has nearly 30% of its pupils on free school meals compared to just 10% in neighbouring East Renfrewshire.

The tables are particularly illuminating where they identify local authorities punching above their weight – or those whose performance is less successful than other areas coping with similar deprivation.

One council that stands out is Inverclyde, which covers some of the most deprived communities in Scotland with more than 20% of pupils on free school meals. It came 12th out of Scotland's 32 councils in exam performance, beating areas such as West Lothian, South Lanarkshire, Renfrewshire, Fife, Angus and Moray.