Their ambition was to outdo the 7/7 attacks, but at times they seemed more akin to characters in the film Four Lions

Late into the night, the sound of rustling and muffled voices from within a one-bedroom council flat in Birmingham raised the stakes in the biggest counter-terror operation since a plot to blow up transatlantic airliners was foiled in 2006.

For 56 days, the activities of the men inside had been watched and analysed by the security services and police, who were assessing whether they were foolhardy braggarts or a threat to public safety. At times they appeared more akin to the characters in the Chris Morris satire Four Lions than a serious terror threat. One of the men said as much himself.

But as the weeks went on, the group began to belie their hapless appearance and raise serious fears that they could be building the capability to cause mass murder. As one source said: "In intelligence work, knowledge of what is actually going on is very, very partial. You are having to make judgments based on incomplete or missing bits of information."

Over two nights in September 2011 the plot came to a head, in the minds of the police and security services, when the three key players in the group were overheard on a surveillance probe trying to create improvised explosives in the flat on White Street. Operatives heard the sound of rustling as the men opened a sports-injury cold-pack to extract ammonium nitrate for their bomb, and heard them discussing how they were going to make the device.

Led by Irfan Naseer, a pharmacy graduate from Sparkhill, in Birmingham, who was known to friends as Chubbs, his friend Irfan Khalid, or Little Irfan, and Ashik Ali, a bicycle repairer, the group had been watched intently for weeks by the authorities.

The security services were aware that two of the three key players, Naseer and Khalid, had visited al-Qaida training camps in North Waziristan and sent others out to be trained. They knew that while in Pakistan these two individuals – who radicalised themselves by reading Anwar Awlaki's Inspire magazine – had managed to establish contact with al-Qaida and travel to the tribal area of Miran Shah for training.

"We had a couple of Britons who had no contacts whatsoever who managed to make their way out there into Pakistan and move to the heart of the beast. They made contact not with just any bit but the international operations section of al-Qaida, which was responsible for previous attacks in the west," said a source close to the investigation.

While the pair were still in the tribal areas, plans were put in place to collect evidence on them when they returned. In the spring of 2011, officers from West Midlands police counter-terrorism unit were called in to work closely with the security services and covert surveillance measures were set up, including placing bugs in cars belonging to Naseer, at the flat in White Street, and in the vehicle driven by Rahim Ahmed, the group's chief fundraiser.

"We knew what they were doing, we were preparing for their return from Pakistan to make sure we had full control of them, and to ensure that if they did something we would capture the evidence and be able to intercept them," a source said.

After Naseer and Khalid returned in the summer of 2011, surveillance photographs taken during July and August revealed how the group were duping members of the public into donating thousands of pounds to fund their mission by posing as collectors for the charity Muslim Aid in the Coventry Road and Stratford Road areas of Birmingham. Ahmed, an unemployed law graduate, had been picked as the main fundraiser and the money flowed in from unsuspecting members of the public. Within two weeks, the men had collected £14,500.

Ahmed was given the task of investing the money to increase the returns but his financial prowess proved questionable. Trading on the internet, he went out to make a cup of tea in the kitchen and in the space of two minutes while the kettle boiled managed to lose £3,000 – while police and the security services were listening in. In two weeks he lost £9,000 of the group's haul, and he was dropped as chief fundraiser soon after.

In the middle of August, the police and security services stood back as four individuals recruited by Naseer, Khalid and Ali left Birmingham for training in Pakistan. The decision not to intervene was a difficult one, according to investigative sources. "Should we let them go and get the skills, should we risk them carrying something out in Pakistan or Afghanistan? There was a lot of discussion, it was difficult but we didn't have enough evidence to charge the rest of the UK network, and if we had showed our hand it could really backfire," the Guardian was told.

What the authorities could not have foreseen was the intervention of the men's families within the Sparkhill community. When relatives of the four individuals who were recruited – 21-year-old warehouse workers Ishaaq Hussain and Khobaib Hussain; Shahid Khan, a law student at the University of Wolverhampton; and Naweed Ali, 24 – heard about their trip to Pakistan, they grew concerned that they were being radicalised.

They made contact with the men and persuaded three of them to return home after a few days in the camp. All four have now pleaded guilty to preparation of terrorist acts.

By early September the chatter among Khalid, Naseer and Ali was becoming more worrying. Driving in a car they bought with Muslim Aid collections and which investigators had bugged, they commented: "It's the four suicide bombers driving around ready to take on England."

On another occasion the men discussed when the MOT on the car was due. Ali replied it was valid until July 2012, to which Khalid responded: "Yeah, we are already dead by then."

Details of how they were going to make the explosives were also emerging. The men were overheard discussing sourcing nitrate pills from cold packs bought over the counter in pharmacies to treat sports injuries. The men discussed their need for a timing device and an alarm clock, and discussed cover stories for purchasing large amounts of the cold packs. Ali was watched as he bought blackout curtains for the flat in White Street from Argos.

Although no target was ever discussed, their ambition was to outdo the bombers from the 7 July 2005 attacks in London. Naseer told his associates the plan was for "seven or eight [bombs] in different places with timers on at the same time: boom, boom, boom". He and Khalid also discussed their time in the terror training camp in Miran Shah, revealing how they hid from US drone attacks for four hours.

What also became clear was that while they were in the camps they had made martyrdom videos to be released after their deaths, along with messages for their families.

In his video, Naseer gave his reasons for the plot. "You people think that by making these cartoons of the Prophet that you are going to deface him. No, you will never achieve this, only thing you will achieve is suicide bombers on your streets spilling so much blood that you'll have nightmares for the rest of your miserable lives."

Two days before his arrest, Khalid was overheard saying: "You know something … this is revenge for everything. What we're doing is another 9/11."

On the night of 17 September, Khalid and Ali were watched as they met at the flat in White Street and were overheard discussing how they would make a bomb. Late into the night they were heard talking about how they would disguise the experiments by drilling into the wall to cover what they were doing.

Inside the flat they were heard opening a packet and extracting what they believed were nitrate prills for the bomb-making experiment. "You could hear them talking and paper rustling and these sort of background activities as they did the experiments," one source said.

It was at this point that the threat to public safety was considered great enough to move in and make arrests two days later. "The best evidence is people having suicide packs on their back and stopping them wherever they are going to do the attack. We didn't have that. But this was a real game-changer: it moved the situation from us just watching to having to do something," said a source.

The men were arrested shortly before midnight on 18 September by officers who arrived in an unmarked police car off Ladypool Road in Sparkhill. The encounter took a matter of minutes and the men were led away quietly.

When the police entered the flat in White Street, they unearthed a mass of other evidence. In a binbag in the kitchen they discovered a charred note, which Ali had been told to dispose of but which in large part remained intact. When pieced together, it contained a diagram and instructions – handwritten by Naseer – of how to make an improvised explosive device.

Officers also discovered Naseer and Khalid had spent the best part of two years plotting their attacks. As well as training in North Waziristan with al-Qaida in 2011, they had both travelled to Pakistan in March 2009, where they spent eight months being radicalised and trained in order to return and recruit others for their plot.

Charity 'a victim'

The charity whose name was misused by the three convicted men to raise money for terrorism has insisted that it has improved the security of its street collections.

Irfan Naseer, 31, Irfan Khalid, 27, and Ashik Ali, 27, all from Birmingham, were part of a group that collected £13,500 that was supposed to be for Muslim Aid.

However, only around £1,500 of the cash actually went to the charity, while the rest was intended for the group to fund terrorist atrocities.

In a statement, Muslim Aid said: "We welcome the conviction and sentencing of the individuals who were not Muslim Aid volunteers but used our name and property to collect funds illegally for their intended criminal activity.

"A volunteer of the charity who pleaded guilty at an earlier hearing assisted these individuals and abused the name of Muslim Aid without our knowledge. We would like to reiterate that Muslim Aid is a victim of this fraudulent activity.

"Our volunteer policy adheres fully to legal requirements. We always obtain prior permission of the relevant authorities for street and door to door collections, and ensure that charity funds are used for their intended purpose.

"We would like to reassure the public that we have taken steps to improve the security of our street collections and branded property. We encourage our donors to check the credentials of collectors when they are approached for donations."

The charity uses funds to support anti-poverty projects around the world, including supporting elderly people and the homeless in the UK.

The statement said: "It is the support of our hard-working volunteers that enables Muslim Aid to help thousands of people.

"We will continue our charitable work with the help of these kind and upstanding volunteers and well-wishers.

"We thank the community for their understanding and continued support for the charity's humanitarian work."

The plot was brought to Muslim Aid's attention by West Midlands Police.