A TEACHER who was found dead as police investigated claims of his "inappropriate conduct" towards pupils has left almost £1 million to his school in his will.

James Rainy Brown, 75, who had worked for 52 years at fee-paying Merchiston Castle School in Edinburgh, hanged himself at his home shortly after being told of the investigation.

It is understood the claims involved lewd and inappropriate comments to pupils rather than physical abuse.

Now it has emerged he had a fortune of £1,485,592 at the time of his death in April this year.

After leaving small bequests to family and friends, he instructed that the bulk of his wealth should go to the boys' school, which charges up to £26,655 a year.

The teacher asked for his donation to be split into three parts. He asked that the first tranche of money be used to make improvements to Pringle House, the school's junior boarding house.

Mr Rainy Brown requested the second part be used to help pupils who were in financial difficulty and the third sum for the general running of the school.

He also left bequests to charities Christian Aid, Scripture Union Scotland and Age Concern Scotland as well as Edge Grove school in Hertfordshire. His wealth was mainly made up of a stocks and shares portfolio worth almost £1m and his £330,000 home in Colinton, Edinburgh.

Mr Rainy Brown's death shocked colleagues at the school where he had been "an enduring and almost ever-present fixture" since arriving as a pupil in 1951.

After gaining his physics degree from Edinburgh University, Mr Brown rejoined the school as a science and maths teacher in 1960.He was found dead at his home shortly after learning about the historic allegations against him.

At the time, a spokesman for Mr Rainy Brown's family said: "It is so unfair that it should happen to a man who dedicated his entire life to teaching and helping generations of children.

"We are 100% confident that, when the police have finished their work, his name will be cleared."

Head teacher Andrew Hunter said the news that JRB - as the teacher was known - had died was "a tremendous blow to the entire Merchiston Castle community".

He added: "He was an outstanding teacher and academic, sports coach, outdoors enthusiast, housemaster and tutor and leaves an indelible mark across so many aspects of the history of this place."

Mr Rainy Brown had never married or had children.