Saeed Alim known to friends as Nicky Reilly who yesterday admitted attempting to blow up the Giraﬀe restaurant in Exeter. Photograph: Lewis Whyld/PA Lewis Whyld/PA

A "vulnerable" convert to Islam, who attempted to blow up a busy lunchtime restaurant in Exeter, was aided and encouraged by al-Qaida sympathisers abroad, police revealed yesterday.

Mohammad Rashid Abdulaziz Saeed Alim - known as Nicky Reilly to friends and family - had scouted out alternative targets in Plymouth including a police station, the Drake Circus shopping centre and Devonport dockyard, the Royal Navy's base for refitting nuclear submarines.

Appearing at the Old Bailey via video-link, the 22-year-old, who suffers from Asperger's syndrome, admitted the attack on the Giraffe restaurant in May this year. It failed because one of the home-made devices he was priming in the restaurant toilets partially exploded and he was unable to get out of the cubicle.

Speaking from Belmarsh Prison, Saeed Alim answered "guilty" twice to charges of attempted murder and preparing a terrorist attack. He wore a blue, short-sleeved shirt and dark navy tie. Saeed Alim became interested in Islam, the court was told, when he was 16 or 17. He began preparing his bomb attack in January, researching terrorism and watching a YouTube video titled Home-made Bomb.

The judge, Mr Justice Calvert-Smith, said: "He became increasingly drawn to violent action in support of fellow Muslims in revenge for perceived persecution and to the idea of himself personally becoming a martyr." He also bought a suicide vest.

"During the early months of 2008 he was in frequent touch with two other people, as yet unidentified, with whom he discussed his intentions and from whom he received a certain amount of encouragement and information," the judge said. "There was some debate - revealed by comments in the computer - about what sort of person should be targeted, whether public servants such as police officers, other public servants or ordinary citizens."

He built two types of improvised explosive devices, one using caustic soda and the other kerosene. "He ... tried to increase the potential for injury and death ... by putting chemicals in glass bottles and filling those bottles with around 500 nails.

"He travelled to Exeter on the morning of May 22, by bus from Plymouth with six bottles, three containing caustic soda, three kerosene and another chemical contained in drain cleaner."

After the explosion, the restaurant manager evacuated everyone. Saeed Alim, who was injured and covered in blood, was arrested at the scene.

In interviews with police, he said he intended running into the restaurant clutching the devices to his stomach where they would explode and kill him. "His recollection is that he was not able to open the lock on the cubicle door by which time the first device had exploded," Stuart Baker, prosecuting told the court

Debbie Simpson, the assistant chief constable of Devon and Cornwall Police, said the aim had been to "kill and injure members of the public" and "spread panic". She revealed that Saeed Alim took photographs of the bombs before setting out. Two other men arrested in connection with the inquiry have been released without charge. Simpson said the Giraffe restaurant was probably targeted simply because it was near where the bus stopped in Exeter.

Saeed Alim faced many problems. Kerim Fuad, defending, said he had "rather simple characteristics". The police said they treated him as a "vulnerable adult".

He has Asperger's syndrome, a form of autism, which meant he struggled at school. Friends say that as a boy he tended to retreat into a fantasy world. He was obsessed with James Bond, and he would imagine himself as a super-spy.

As a teenager, his height and weight earned him the nickname BFG - the Big Friendly Giant, after the Roald Dahl story. But friends claim his mental health deteriorated after he split with his first serious girlfriend. He harmed himself and was admitted to local mental health services.

He shared a small flat in King Street, in a deprived area of Plymouth close to the city centre, with his mother, Kim, her partner and two half-brothers. Three months before the attack in Exeter, his younger brother, Luke, 20, was sent to a young offenders' institution for six years after admitting beating and kicking a Polish worker unconscious before robbing him in a city centre alleyway. On the same night, Luke Reilly robbed a 16-year-old.

Within hours of the attempted bombing, Devon and Cornwall police said they believed he had been preyed upon and radicalised because he was vulnerable. Saeed Alim, who remains in custody, will be sentenced on November 21. The defence will present psychiatric reports about his condition.

'My son was brainwashed'

Kim Reilly, Saeed Alim's mother, said her son had been "brainwashed". He began to change because of "all the people that he was hanging around with," and began to express extreme views. "He believed that he was on the right path, he had found the right religion and this was the right way of life," she told the BBC.

"He would have had to have instructions or guidance from someone. Somebody has brainwashed him, he has done the work and they are walking free."

His grandfather Raymond Reilly said yesterday: "Nicky is a lovely boy and we all love him dearly. The people who preyed on him chose him because he was vulnerable and a sick boy. He has never been into drugs and never smoked and never drunk and never been in trouble with the police before. He would not hurt a fly and is a wonderful grandson. The people who radicalised him have taken him away from us."

The influence of extremist websites is clear in a suicide note Saeed Alim left at home. In it he paid tribute to "Sheikh Osama" (bin Laden) and called on the British and United States governments to leave Muslim countries. Echoing a comment made by bin Laden in the wake of the September 11 attacks and adopted by many radicals, he said: "We love death as you love life."