You don’t win many votes for foreign policy.
But then he was taking advantage of another political adage.
You can lose votes for foreign policy.
Following the hundreds of deaths of migrants trying to cross the Mediterranean from Libya to Italy, the Labour leader clearly decided it was a good moment to attack David Cameron for the ill-thought out intervention in the north African state that helped overthrow Colonel Gaddafi in 2011 and then the subsequent failure to support efforts to prevent the country collapsing into the state of anarchy the people smugglers and migrants are taking advantage of now.
As Mr Miliband tacitly acknowledged in his speech, Labour knows how foreign policy can lose you votes when he referred to learning the lessons from the 2003 Iraq invasion more than once.
He knows many of the votes his party lost to the Liberal Democrats in 2005 and 2010 were because of Iraq.
To be fair to him, Ed Miliband did more than take a pop at David Cameron’s record.
He made a reasonable fist of his speech – he pointed out the world is not a stable place at the moment and there are a variety of problems that the world’s fifth largest economy with – despite spending cuts – some of its more capable diplomatic and military services should be doing more to help tackle.
His analysis of the complex challenges facing the world ticked most of the right boxes – and he is to be praised for emphasising the threat posed by climate change and the opportunity to do something about it at the next UN climate summit in Paris in December.
But if he does replace Mr Cameron in No 10, will he follow through on his promises?
Would a Labour government re-engage with Britain’s EU partners to make the reforms many agree are needed in the revive the Union?
Would a Prime Minister Miliband increase defence spending to meet the 2% of GDP the country committed to at the last NATO summit? He hinted strongly yesterday that his party would spend more on defence without actually saying he would.
Miliband defended his opposition to military intervention against Syria which led to the government’s defeat in parliament – a vote many commentators – reading too much into it – saw as a symptom of Britain’s increasing isolationism.
He says military action is sometimes necessary, but should be a last resort and be undertaken in alliance with others, including regional powers.
But whether the voters agree is another matter.
It is notable that when the last British troops left Afghanistan after a 13 year mission last October it was a headline for a few hours and there was very little fanfare.
Neither of the interventions in Iraq and Afghanistan were very successful in their own terms and many British people don’t seem to think the casualties suffered were worth what was achieved.
While it is true that foreign policy is not something that attracts mass interest and is often the reserve of the few, the appeal of a party like UKIP seems to derive partly from a weariness with – and wariness of – international involvement.
And also to say foreign policy has been largely absent from the campaign is only true if you define it narrowly.
Several foreign policy issues are playing a prominent part.
After all, UKIP’s raison d’etre is getting out of the EU – a more significant foreign policy move for the UK is difficult to imagine – and the Conservatives are promising an in-out referendum on membership if they win.
Immigration is a concern to many voters – all the parties talk about the need to control it – whether they are basically for or against it. And though immigration is usually categorised as domestic policy area, it cannot be seen in isolation from foreign policy.
One of the reasons migration to and from Britain is quite high is that recent governments – both the last Labour administration and the current coalition – have said they want Britain to be a global hub – not just for business, but for education, culture and diplomacy too.
Another issue that has come up in the campaign and featured in the TV debates is overseas aid – a fundamental plank of foreign policy.
UKIP are calling for the aid budget to be cut and the money spent at home, but this is an area where David Cameron is not guilty of Ed Miliband’s charge of being small-minded and inward-looking as his government protected foreign aid from cuts and he is committed to the 0.7% of GDP spending target if he is returned to power.
So foreign policy is part of the warp and weft of the campaign, but what was largely lacking until yesterday’s speech was an attempt to join up the dots and spell out a role for Britain in the world.
Will David Cameron take up the challenge to give voters the Conservatives’ overall vision for foreign policy?