David Shayler had to provide the names of seven referees before he was taken on by the UK intelligence agency MI5.

Despite making it through such supposedly tough vetting procedures, many people who knew him throughout his life warned he lacked crucial qualities needed to be a spy.

To his friends, he is a brave if indiscreet idealist who sees himself exposing illegal undercover activities.

For others, including his grammar school headmaster and some former employers, he is a braggart who craves attention and glory.

Mr Shayler attended John Hampden Grammar School in High Wycombe, Buckinghamshire. The head teacher described him then in a report as "a born rebel who sails close to the wind ... and suffers neither fools nor their arguments gladly".

Shayler printed extracts of Spycatcher

He went on to attend Dundee University, where he achieved a 2:1 in English, before being taken on as a trainee with The Sunday Times.

He had attracted the paper's interest by publishing extracts of a banned book by former MI5 officer Peter Wright, Spycatcher, in his time as editor of student magazine Annasach.

His biggest scoops for the Sunday papers came after he had been fired, however.

Sunday Times executive James Adams told The Sunday Telegraph last year: "He failed to make the grade so he was sacked after six months.

"The criteria that were used were classic journalistic ones - did he have ideas or show initiative and that kind of thing?"

Resurfacing at MI5, he worked first in C Branch vetting government officials, before moving to tackle counter-subversion and international terrorism.

In particular, he sat on the Libyan desk, from where he could claim to have picked up his allegations of a plot involving Colonel Gaddafi.

By the time he parted company with the intelligence service in March 1997, he had a book synopsis in his hand - but failed to attract a publisher.

The Mail on Sunday was the first national newspaper to risk the wrath of the government and run stories based on Mr Shayler's "secrets".

Straw: Was under MI5 surveillance

The tabloid was believed to have paid him about £5,000 to learn MI5 had carried out surveillance operations, including bugging, on many prominent people, such as the Trade and Industry Secretary Peter Mandelson and John Lennon.

This disclosure was in effect confirmed earlier this week when MI5 posted its first Website and admitted Home Secretary Jack Straw was another Cabinet member among the thousands of names on its files.

Though less dramatic than Peter Wright's allegations of a plot to overthrow former prime minister Harold Wilson, Mr Shayler's splash worried MI5 as they had received no prior intelligence of it and missed their chance to take out an injunction.

Wright alleged a plot to overthrow Wilson

Former MP Rupert Allason, an author of spy thrillers, said at the time: "MI5 had heard rumours that a former employee was touting a book around London but they thought it was a woman.

"I can tell you they are absolutely devastated by this. It's much worse than Spycatcher."

The attention forced Mr Shayler and his girlfriend Annie Machon - who also worked for MI5 - to seek exile in France.