Police searched a number of properties in Liverpool and Manchester
Two Pakistani students arrested over an alleged terror plot are to fly home after deciding to leave the UK voluntarily, their solicitor has said.
Abdul Khan, 26, and Shoaib Khan, 27, were among 12 people held by police after raids in north-west England in April, but the pair were never charged.
The Home Office tried to deport them, saying they remained a security threat.
The men decided to leave after being denied bail while appealing against deportation, their solicitor said.
The appeal was due to be heard by the Special Immigration Appeals Commission (Siac) in March next year.
The men's solicitor, Amjad Malik, said his clients would leave on an evening flight to Islamabad on Friday night.
The pair, who are Category A prisoners at HMP Manchester, were "devastated" by the decision to deny them bail, he said, and could no longer face further incarceration.
"They realised that they are going to remain in custody for another 10 months when they haven't committed any crime - that amounts to a sentence of three years," Mr Malik said.
"Also, Ramadan is coming nearer and they are not happy with the facilities in place in prison, so they wish to spend their Eid [Muslim festival for the end of the fasting month, due on 20 September] with their families in Pakistan."
He added that the men would be allowed to continue their UK studies from Pakistan.
Abdul Wahab Khan, from Tank, in the North West Frontier, was studying for a masters degree in computer studies at John Moores University in Liverpool.
Shoaib Khan, from Narowal in the Punjab, was taking an accountancy course at Kaplan Financial, which has training centres across the UK.
Mr Malik said the UK Border Agency, part of the Home Office, had withdrawn its "intention to deport" orders to allow his two clients to return home.
Twelve students were arrested in the terror raids in Manchester and Liverpool as part of Operation Pathway, with three subsequently released.
The Home Office is attempting to deport two others, Sultan Sher and Janus Khan, on the grounds of visa irregularities after dropping claims that they posed a threat to national security.
Five more, referred to only as VE, UF, ZA, YB and XC, are to appear before Siac for their deportation appeal hearing on March 10.
Last week, Mr Justice Mitting ruled that Abdul Khan and Shoaib Khan, along with three others who applied for bail, should be held in custody until then.
Evidence passed to the tribunal claimed one of the men, who cannot be identified, exchanged e-mails with an associate of al-Qaeda.
MI5 analysis also suggested girls' names were used as code for bomb ingredients and that the mention of a wedding hinted at a planned attack.
The Home Office has refused to comment.