They were not the happiest days of my life. The happiest days of my life are now. But my two years in the sixth form of Sheffield City grammar school were pure joy. Much of the pleasure came from football and cricket. But there was added delight in the surprising discovery that I could pass exams. And it has to be admitted that we happy few who had "passed the scholarship" enjoyed all the satisfaction that comes from supposed membership of an elite.

Peter Middleton, who came into the sixth form via an "intermediate" (that is to say, "not quite passed") school, was regarded with undisguised suspicion. He went on to be permanent secretary to the treasury and chairman of a bank. The Chatterley gamekeeper boasted of education at a grammar school in Sheffield. Later Jarvis Cocker was added to the list of distinguished old boys. For reasons I could never fathom, the City Grammar badge was the phoenix. Today, with the school it evolved into gradually emerging from "special measures", the choice of emblem seems prophetic.

For 11-plus "failures", life was not so good. So I was delighted when, in 1969, the City grammar turned comprehensive and became the City school. It moved from Victorian stone, across the road from the town hall, to postwar concrete on a housing estate. Instead of carefully selecting its pupils, it accepted every boy and girl whose parents applied. Over the years I have tired of being told that people like me have betrayed our history, so I went to see how my alma mater was dealing with challenges it never faced in my day.

Pride or sloth

When I first visited, last March, 40% of the most recent entrants needed - in the judgment of their primary schools - extra help to achieve their full potential. Although only 26% applied for free school meals, the staff told me that far more qualified, but, because of their parents' pride or sloth, did not take up their entitlement.

In the summer of 2006, 34% of the City school's GCSE candidates gained five or more passes at grades A*-C. The head was certain that the figure would rise to 43% this year and that the magic 50% was not far away. In February 1951, the exam successes recorded by the City grammar school magazine (which included a poem in praise of the Attlee government by RSG Hattersley, Lower VI) were: 75 school certificates and 32 higher school certificates. Thirteen sixth-formers went on to university - 10% of the carefully selected pupils. In value-added terms, it was difficult to decide which school came out better.

When I made that first visit, I did not know, nor was I told, that in 2005 the school had been given a notice to improve. A month after I was there, it was put into special measures.

Having read the inspectors' report, it seems incredible that the obvious shortcomings were not identified earlier and remedied at least two years ago. The head, who left by mutual agreement, bore most of the burden of failure. But where were the governors and the local education authority?

The task of turning the school round in four terms was entrusted to David Lack, a retired headteacher who had already been employed to revive two other schools in special measures. Both were restored to acceptable levels of achievement. In July, I returned to the school to discover his recipe for improvement.

Lack regards GCSEs and their equivalents as, at most, a shorthand indication of the wider and deeper improvement that he is determined to bring about. When the results improved, he said, critics would attribute the changes to the decision to switch some pupils from GCSEs to the less academic B-Techs. But he regards the changes as essential to his object of making the courses suit the student, rather than vice versa. The inspectors who recommended special measures identified "engaging students' interests ... as essential to the improvement of attendance and standards". But the first requirement was a leadership that provided a clear strategic direction. Lack puts the problem more succinctly. "The students were setting the agenda," he says.

"Some lessons were obviously not prepared or at least not prepared on paper," he says. His messages to pupils and parents refer to the many outstanding members of staff who survive from before the inspection. But to ensure standards across the board, he gave every staff member a "planning for learning" pack to help create "effective lessons in which pupils' learning and engagement are maximised".

At first the NUT, which should have wondered why qualified teachers needed such guidance, complained about the extra demands on its members' time. Now the changes are generally accepted and welcomed. Lucy Rodgers, acting head of the technology department, says the school before Lack's arrival was like a house that was falling apart: "Now all the pieces are being put back together."

A quarter of the staff resigned last spring. Half a dozen more were encouraged to take early retirement; a similar number refused to accept the new regime. Lack refused to make up numbers by employing newly qualified teachers. He filled the gaps by using recruitment agencies. Many of the replacements were better qualified and more highly paid than their predecessors. The higher pay rates, agency commission and redundancy payments added £100,000 to the budget. The local authority has no choice but to accept that this year the school will overspend.

The changes are welcomed by those parents who stuck by the school. A gathering of 150 year 6 parents - about half the number invited - was totally supportive. But special measures took a toll. Before Easter, the September intake was oversubscribed. Two weeks ago, only 250 of the expected 300 pupils took up their places.

Outstanding teaching

But that first day of term may mark the end of the City school's travails. Last week Ofsted inspectors carried out an interim inspection. They reported "satisfactory progress", identified some "outstanding teaching", and attributed the revival to the new measures and changed structures. The dramatic improvement in GCSE results (<46% of candidates achieved five or more passes with grades A*-C) was obvious "evidence of the impact" of the new regime. This time, he says, "the staff were not the slightest apprehensive about the inspection". And he makes a bold prediction. "The City school will be out of special measures on schedule next year."

Then, with luck, morale of staff and students will be improved by the promise of a new building, and parents will once more make the City school their first choice. But there will still be competition with the city academy down the road, which will be regarded as the brightest and best. The staff will still have to cope with all the problems of social deprivation, some of which were at least partly responsible for its decline.

One question remains unanswered. Would the City school have remedied its record of underachievement without special measures? By March 2005, only a short, sharp shock - and the dramatic reorganisation that followed - could have prevented a further descent into apathy and the chronic acceptance of underachievement. But somebody - governors, LEA or the education department - should have seen what was coming and intervened far earlier.

What would have happened if the extra £100,000 to be spent on staff next year had been invested five years ago? The record suggests that the City school was in urgent need of help that it did not get until it was too late to avoid a generation of pupils being denied the education they deserved.