The Home Office "checked repeatedly" with Europe's human rights court about when the deadline for any appeal over terror suspect Abu Qatada's deportation could be made, David Cameron has said.
The Prime Minister denied making a "complete mess" of getting Qatada out of the country, saying the Home Office was "very clear" about the date, had checked with the court and considered the precedents.
Home Secretary Theresa May has insisted that the appeal by the radical cleric's lawyers should be thrown out because it missed a three-month deadline, but advice from the research department of the Council of Europe - which is responsible for the court - suggests otherwise.
The confusion could lead to Qatada being back on British streets in just two or three weeks.
Mr Justice Mitting, president of the Special Immigration Appeals Commission (Siac), returned Qatada to jail after his arrest last week.
But he warned: "If it is obvious after two or three weeks have elapsed that deportation is not imminent... then I will reconsider bail along the basis of a more leisurely timetable than that necessarily required for a full-blown appeal to Siac."
Mr Cameron told BBC Radio 4's Today programme: "The Home Office was very clear that it had the right date for the deadline expiring on the Monday evening (April 16).
"It had checked repeatedly throughout that process, it was working on that basis and all the case law pointed in that direction, so it was very clear and Theresa May has been very clear about this."
He added: "The Home Office was working on the basis of the deadline being the Monday night and that is something that they had checked with the court.
"The Home Office was clear about the date, the precedents were checked, and so they acted in my view entirely correctly."