According to a chain of emails, obtained under the Freedom of Information Act, the Home Office permanent secretaries - the department's most senior civil servants - were made aware of the concerns at the time.
Shadow home secretary Yvette Cooper said the emails "demonstrate the Home Office knew that they were breaking the law and lay bare how their chaotic failure to plan led to this situation".