THE prime minister was yesterday unmasked as a problem pupil who narrowly escaped being expelled in his final year at one of Scotland's top public schools.

The revelations surrounding Tony Blair's time at Fettes College, dubbed the Eton of Scotland, have been made in a new biography of the prime minister.

The book, by John Rentoul, claims that he escaped expulsion only after a last-minute plea by his then girlfriend's father.

It states: ''He (Blair) was more than happy to push the public school's rules to breaking point and a little beyond, but he - mostly - stopped short at the stage where his defiance would inflict serious damage to either his person or his academic career.''

After Mr Blair finished his A-levels, Dr Ian McIntosh, the then headmaster, apparently wished to expel him, according to the book.

It was the father of Amanda Mackenzie-Stuart, the prime minister's then girlfriend, who engineered a compromise which allowed Mr Blair to stay on.

The book states: ''Lord Mackenzie-Stuart went to see Mr McIntosh and proposed a compromise: that Blair should live at his house in Edinburgh for the last few weeks of the summer term.''

The two people involved, Lord Mackenzie-Stuart, one of Scotland's finest legal minds, and Dr Ian McIntosh, Fettes' then headmaster, are both dead. Dr McIntosh died in 1975 and Lord Mackenzie-Stuart, an ex-Fettes pupil and a crossbench peer and judge, died in April last year.

Anne, Lord Mackenzie-Stuart's widow, told The Herald yesterday: ''This story is one that keeps coming up.

''I really have nothing more to say about it.''

A Downing Street spokeswoman said: ''I don't know if it is correct or not. We do not make any comment on biographies anyway.''

Amanda Mackenzie-Stuart, now married to Michael Hay, a university lecturer, lives in Oxford and is a film producer and writer.

Mrs Hay, a mother-of-two, was one of the first two girls accepted into the previously all-male bastion of Fettes.

The book also claimed that Mr Blair, who sported longer hair in his younger days and liked Led Zeppelin and Cream, was beaten by Bob Roberts, his house master, while at the college.

The book says: ''Roberts beat Blair, the only master to do so, giving him 'six of the best' at the age of 17 for persistently flouting rules.''

It was known that Mr Blair had been caned at school after he confirmed the fact in 1994, saying: ''It probably did me no harm.''

Mr Blair, at that time, said he backed ''strong discipline'' in schools.

But he came out against bringing back corporal punishment for school children.

However, Mr Blair did not disclose who administered the caning. It was reported at that time that it might have been carried out by Dr McIntosh, who retired in 1971, the year that Mr Blair left the school. However this was never confirmed.

Corporal punishment at the 131-year-old college was stopped 22 years ago.

The Labour leader left the college with three A-levels and went to St John's College, Oxford.

A spokeswoman for Fettes said yesterday it could neither confirm or deny the book's contents in relation to Mr Blair's time at the school.

She said: ''It is such a long time ago that I doubt we could make any comment.''

Fettes is one of the most prestigious public schools in Britain with a history which dates back to the late nineteenth century.

Founded by Sir William Fettes in 1870, the #15,000-a-year school started life as a private boys school and did not allow girls to join until 1970.

Since its establishment, Fettes old boys have cropped up in some of the most prestigious posts in the world.

Ex-Fettes pupils include three chancellors of the exchequer and two foreign secretaries, while the school's former milkman was Sean Connery.