Graham Maslen is to retire as headteacher of The North Halifax Grammar School next summer.
He took over as headteacher in 1996 and is only the fourth to lead the school since it was formed on its present site in 1959.
Mr Maslen said: “My time at the helm has been challenging but hugely rewarding. Being headteacher of such a great school is one of the best jobs in the world.”
Colin Hartley, chairman of The North Halifax Grammar School Academy Trust, said: “Mr Maslen is well respected and held in high esteem for his effective, imaginative, diligent, unstinting and inspirational leadership.”
The process of recruiting a successor will now begin.