As the Royal School bids farewell to its pupils for the final time after 160 years this month, a new book delves into the annals of this Hampstead institution.

Generations of young girls wearing the school’s signature red beret have made the village their home.

Set up in 1855 to provide a home and education to daughters of Crimean War veterans, the school suffered tuberculosis outbreaks, celebrated royal visits and survived two World Wars.

It was in a quest to weave this rich history together that its outgoing headteacher, Joanna Ebner, helped put together the book, The Story Of The Royal School, Hampstead, along with Sarah Harper Rasmussen.

Writing in the book she said: “Our new patron, Camilla the Duchess of Cornwall, also inspired a new idea: the possibility of a book about the history of the Royal School.

“I had begun to look into the school’s history while carrying out research about the school’s royal patronage from the time of Queen Victoria.

“I realised that the history and traditions of the school had in many ways been lost over time. As headmistress, I felt it imperative to celebrate and commemorate our historical roots.”

Known to its pupils as a beacon of stability and discipline, the school in Rosslyn Hill was borne out of the bloody conflict of the Crimean War.

An article in The Illustrated London News, published on January 26, 1855, welcomed the school’s arrival, which it said would keep young orphaned girls out of the much feared workhouses.

It stated: “In the labour of the trenches – in the midst of pestilence – in the nipping cold and burning heat, and in the roar of battle – many a British soldier has had his mind occupied by the little prattling children who were left without his care 3,000 miles away.”

The book quotes one former pupil who recalled what it was like to arrive at the school in 1917 – when World War I was at its peak.

She said: “I can still smell the home’s carbolic soap and feel the terrazzo floor in the bathroom, but the water was hot and we had never seen such a large bath before.

“We were well scrubbed and then dressed in roomy white nighties, put to bed where we stayed until our uniforms were ready.

“We were given our numbers, Kitty was 75 and I was number 76.”

Much has changed at the school over the past century and a half, but its strong links with the Royal family have remained firm – beginning with its first patron Queen Victoria in 1856 and ending in 2012 with Camilla, Duchess of Cornwall.

As fewer men signed up to the armed forces, and those who did became more likely to take their families with them overseas, the school’s links with the military faded.

It has now been taken over by the independent school chain Cognita and merged with North Bridge House School.

But the book, written by its last headteacher, offers new insights into its fascinating history.