Police searched a number of properties in Liverpool and Manchester
Two students fighting deportation to Pakistan were arrested days before a terror strike they were planning to carry out in the UK, a court has heard.
Abid Naseer and Ahmed Faraz Khan are appealing against the deportation on the grounds they are a security risk.
Mr Naseer was among 12 people held after raids in north-west England in April 2009 but who were never charged.
An MI5 officer told the Special Immigration Appeals Commission they planned an atrocity last April.
This is the first time MI5 has gone on record about why the men were arrested.
The British intelligence officer - identified only as ZR - told the court Mr Naseer was the ringleader and compared the alleged plan to the attacks on London on 7 July 2005 and the 2006 plot to blow up US-bound planes.
Representing Mr Naseer, Joel Bannathan QC asked the officer what he meant, and for two hours the pair verbally sparred.
ZR refused to reveal details in open court, but said: "The overarching similar fashion was that they were all planning a terrorist attack in the UK under the direction of al-Qaeda and these were aiming for mass casualties."
The officer went on: "I'm comfortable that there are similarities between those plots and I'm comfortable to talk about that in closed session."
Mr Bannathan accused the officer of trying to avoid difficult questions, but the officer said he was duty bound to protect MI5's secrets.
The officer told the hearing Mr Naseer exchanged coded emails with an al-Qaeda operative called Sohaib while planning the attack.
Mr Bannathan said Mr Naseer and Sohaib used women's names because as Muslim men this was the only way they could access certain websites.
He said the subject of two of the emails was "Sohaib here", which showed they had nothing to hide.
Three other students also alleged to have been linked to the plot, Shoaib Khan, Abdul Wahab Khan and Tariq Ur Rehman, have already been sent back to Pakistan and are appealing to return to the UK.
The hearing continues.