The foreign secretary has said he would like to see a “sustainable ceasefire” in the Israel-Gaza conflict.
Lord Cameron also warned “too many civilians have been killed” in Gaza.
More than 18,000 people have been killed, including thousands of children, according to the Hamas-run health ministry.
His intervention in a Sunday Times article marks a shift in tone from the UK government, but stops short of calling for an immediate ceasefire.
Penning a joint article with Germany’s Foreign Minister Annalena Baerbock, Lord Cameron said he supported a ceasefire only if it was sustainable in the long term.
He said: “Our goal cannot simply be an end to fighting today. It must be peace lasting for days, years, generations.
“We therefore support a ceasefire, but only if it is sustainable.”
On Tuesday, the UK and Germany abstained over a United Nations resolution, backed by 153 countries, demanding an immediate humanitarian ceasefire in Gaza.
“We do not believe that calling right now for a general and immediate ceasefire, hoping it somehow becomes permanent, is the way forward,” Lord Cameron wrote, seeking to explain the UK’s decision.
“Would Hamas stop firing rockets? Would it release the hostages… an unsustainable ceasefire, quickly collapsing into further violence, would only make it harder to build the confidence needed for peace.”
Instead the UK and Germany are pushing for further humanitarian pauses to get more aid in and more hostages out.
Lord Cameron’s comments amplify Rishi Sunak’s line set out at Wednesday’s Prime Minister’s Questions.
“We have been consistent that what we support is a sustainable ceasefire, which means Hamas must stop launching rockets into Israel and release all the hostages,” Mr Sunak said.
Appearing on the BBC’s Sunday with Laura Kuenssberg programme, Deputy Prime Minister Oliver Dowden said: “In order for a ceasefire to be sustainable, we have to ensure we remove the threat of Hamas from Israel…
“So, that’s why we continue to support Israel in its right to self-defence, to remove the threat of Hamas, and at the same time to get those hostages back.”
Asked if he thought Israel had gone too far, Mr Dowden said: “I wouldn’t characterise it as Israel going too far. Israel is dealing with a very difficult situation.”
He said the UK continued to urge Israel to exercise restraint but added: “If you’re going after an enemy that literally hides underneath hospitals, hides amongst the civilian population, you are going to sustain high levels of civilian casualties.”
The offensive into Gaza, triggered by Hamas’s deadly 7 October attack on Israel which killed 1,200 people, has led to vast areas of the territory being flattened.
In a sign attitudes are shifting, in the article, the UK and German foreign ministers warned that Israel “should do more to discriminate sufficiently between terrorists and civilians”.
They also said more aid must reach Gaza, amid warnings from the United Nations of a humanitarian catastrophe due to widespread shortages of basic supplies.
Israel’s main ally the US has also expressed unease over the failure of Prime Minister Benjamin Netanyahu’s administration to reduce civilian casualties.
Deflecting that pressure on Saturday, Mr Netanyahu said: “Military pressure is necessary both for the return of the hostages and for victory. Without military pressure… we have nothing.”