Gordon Brown has come to the defence of Jacqui Smith, the Home Secretary, in the row over illegal immigrants working in the security industry.
Speaking in the Commons yesterday, he said Worcestershire MP Ms Smith (Redditch) had responded to the problem with "not press releases but action".
But the Prime Minister came under fire from David Cameron, the Conservative leader, for refusing to reveal when he first learned about the issue.
Mr Brown said he was happy for Ms Smith and the Home Office to deal with the issue without involving him.
It followed the revelation that at least 5,000 illegal immigrants had been cleared to work as security guards.
Earlier this week, it emerged that Ms Smith knew about the problem for at least four months before it became public last weekend.
But she insisted earlier this week that she had not told Mr Brown about it.
Challenged by Mr Cameron, the Prime Minister told the Commons that instead of just talking about the problem she had "acted immediately".
In noisy question time exchanges, Mr Cameron said the Government had been "caught red-handed" putting spin before safety.
Mr Cameron said the Home Secretary had been told four months ago that thousands of illegal migrant workers had been given clearance to work in sensitive security posts.
"Why wasn't the public told?" he demanded.
Mr Brown replied: "Because the Home Secretary acted immediately. She put in place the security checks which means that all new security workers are checked and all existing workers are going through checks, which will be completed by the end of the year."
Mr Cameron accused Mr Brown of failing to live up to his promise to be "candid" and to avoid spin. He asked: "Can you tell us when you were told about this problem?"
Mr Brown responded: "The Home Secretary has been dealing with it right throughout the summer. It is an operational question and I'm sorry you put so much onus on press releases. What matters is getting things done."
When Mr Cameron asked him again, the Prime Minister said: "I'm sorry you think everything should go through Number 10. It was the Home Office that was responsible and they took action."
Ms Smith was forced to admit in the Commons this week that as many as 10,000 non-EU nationals licensed to work in the security industry may be illegal immigrants.
Ones of them had been responsible for overseeing then-Prime Minister Tony Blair's car while it was being repaired.
The row was sparked by the leak of Home Office internal e-mails showing Ms Smith had accepted Home Office press office advice in August not to disclose the number of illegal immigrants cleared to work in the security industry, on the basis that "the lines to take" would not be good enough for the public and media.
She confirmed she had been told about the problem on July 2 when licences issued by the Security Industry Authority, which oversees the security industry, were changed to include a check on immigration status.
An inquiry to determine exactly how many of the 40,000 foreign nationals licensed to work as security guards are illegal immigrants will not be completed until next month.
Her statement left open the possibility that up to 10,000 illegal migrant workers may have been licensed to work in the private security industry either as guards or "close protection" personnel.