The UK Border Agency has been criticised by MPs over its failure to deport foreign criminals.
A report from the Home Affairs Select Committee found that 520 foreign prisoners, released between 2010 and 2011, have been allowed to remain in the country.
It also found that six years after 1,013 foreign nationals were released from prison without being considered for deportation, only 397 have been removed or deported.
"Six years is far too long for this situation to be resolved and these cases should have been concluded long ago," the committee said.
Almost 20,000 asylum cases also remain unresolved and some 120,000 immigration cases are being written off because the applicant can no longer be found, it added.
The committee also questioned why some 700,000 migrants were applying for multiple visas every year.
MPs asked whether an applicant could have "legitimate reasons for applying for three or more visas" and called for the agency to look into imposing a limit.
The agency's refusal to recognise the term "bogus college" and the fact it gives advance warning of half of its college inspections was also criticised.
All inspections of colleges sponsoring foreign students under tier four of the visa system should be unannounced in future, the committee said.
It also stressed that the mothballing of £9.1m Iris scanners at airports after just five years "should not be repeated".
Any data collected on e-Gates trials should be published to ensure it does not "suffer the same costly investment in equipment which will not last", the report said.
Keith Vaz, the committee's chairman, said: "The reputation of the Home Office, and by extension, the UK Government, is being tarnished by the inability of the UK Border Agency (UKBA) to fulfil its basic functions.
"The foreign national prisoner issue and the asylum backlog were scandals which first broke in 2006, six years ago.
"UKBA appears unable to focus on its key task of tracking and removing illegal immigrants, overstayers or bogus students from the country."
Immigration Minister Damian Green, speaking to Sky News, admitted the UKBA was "far from perfect".
"We have been making it better in the two years since we have been in government. Some parts are getting better faster than others," he said.
"We inherited a chaotic legacy and inevitably it is going to take a few years for the worst parts of it to get up to speed."
He insisted it would not take four years to clear the backlog but refused to put a deadline on when it would be dealt with.
"I absolutely share the frustration of it taking so long. We now start deportation proceedings 18 months before the end of the prison sentence and that is starting to improve the situation," he said.
"We are blasting away on all these fronts and in the next few weeks we will be announcing changes in immigration laws to make it much more difficult for people to abuse the human rights act to ensure that they can stay in this country when frankly we all want to seem them deported."