It comes after the DUP leader had given Westminster an ultimatum on the issue - respond to what he branded "a crisis" for Northern Ireland in 24 hours or he would resign.
The threat to quit came after revelations sparked by the collapse of the case against Co Donegal man John Downey, who had been charged over the 1982 Hyde Park bomb which killed four soldiers.
Mr Downey walked free from the Old Bailey because he was sent a letter by the PSNI wrongly telling him that he was not wanted over any crimes - despite an arrest warrant having being issued by the Metropolitan Police.
"I agree with the First Minister of Northern Ireland that, after the terrible error in the Downey case, it is right to get to the bottom of what happened," Mr Cameron said on Thursday, as he appointed a judge to head up the inquiry.
"The case has already been referred to the Police Ombudsman but, as the First Minister has said, we should have a full, independent examination of the whole operation of this scheme."
Mr Robinson responded saying: "I am happy with the terms of reference that have been set out."
In explaining how the situation had come about, Mr Cameron earlier said: "When we came to power in 2010, we inherited a process where letters were sent setting out the factual position on whether or not some individuals were wanted for questioning by the police.
"This process continued under this government. There was never any amnesty or guarantee of immunity for anyone, and there isn't now."
The Prime Minister continued: "It is right that we take swift action, but let us also remember that Northern Ireland has made great strides forward as a result of the peace process.
"It is vital that we deal properly with the events of the past but make sure this never undermines our determination to build a shared and prosperous future for the next generation, so that we never again return to the horrors of the past."
According to Mr Cameron, the inquiry into the on-the-run letters must be completed and have reported its findings by May of this year.
The First Minister had said that he was not prepared to lead an administration which had been "kept in the dark" by Westminster governments, past and present.
Mr Robinson insists that he and his party were not aware that immunity letters had been issued, adding that he would not have entered into power-sharing with Sinn Féin if they known.
As well as a full inquiry, he had called for the letters to be rescinded.
Of the 187 on-the-run letters, 38 were issued since 2010 - when justice powers were devolved from Westminster to Stormont.
Secretary of State Theresa Villiers has said the government will ensure that the letters do not amount to immunity for those who received them.
"We will take whatever steps that are necessary to make clear to all recipients of letters arising from the administrative scheme, in a manner that will satisfy the Courts and public, that any letters issued cannot be relied upon to avoid questioning or prosecution for offences where information or evidence is now or later becomes available," she said.
But Sinn Féin's Gerry Kelly, who was involved in the process dealing with on-the-runs, has insisted that the letters should not be revoked because those who received them had applied through the system put in place for them.
I think this is a political fig leaf.
Gerry Kelly, Sinn Féin
Mr Kelly added that Attorney General Dominic Grieve had stated that the process was "entirely lawful".
He said: "I'm not sure what there should be an inquiry into.
"However, if that's what's needed ... I think the crisis that's been talked up here is a manufactured crisis and if this allows us to move through it, then I supposed the British Prime Minister has made that decision and there's not a lot that we can do about it."
Earlier on Thursday, Sinn Féin deputy First Minister Martin McGuinness had called for "cool heads" to prevail and stated that the resignation of his partner in government would achieve nothing.
His comments came after urgent talks with Northern Ireland Secretary of State Theresa Villiers and representatives of the US administration.
Mr McGuinness further said that his party was "not afraid of an election", in response to the possibility that the current government at Stormont would collapse if Peter Robinson had resigned.
The Assembly has already been recalled for an emergency session on Friday.