Performing the duty on behalf of the Queen for the first time, Mr Cameron inspected the troops in the quadrangle at the Royal Military Academy in Surrey, watched by thousands of the cadets’ friends and relatives.
Mr Cameron told the cadets the country should have “the greatest possible pride” in them.
The PM said:
As a government, we will do everything we possibly can to support you and look after your families and to rebuild the military covenant that is so important to our country.
Many of the cadets will be deployed to Afghanistan following their training and Mr Cameron spoke of the challenges and demands that will be placed on them.
Your training here has given you the best possible start. You will need to continue to develop all these skills and more.
But I want you to be proud of the difference that you can make. The security of our nation - and that of our allies across the world - is at stake.
If we leave Afghanistan now, Al Qaeda will again use Afghanistan as a base from which to attack the West.
I say - we cannot let that happen. But it’s what you will do that will actually prevent it. You will be helping to defend our way of life.
The PM also presented several of the cadets with awards.
Those being honoured included Senior Under Officer Timothy Towler, 23, from Hampshire, who was given the Sword of Honour for being considered the best on his course.
Among the dignitaries present was the King of Swaziland, the President of Yemen, the Prime Minister of Bahrain and the Ruler of Umm Al Qaiwain in the United Arab Emirates, all of whom had sons or grandsons passing out.
Mr Cameron held a meeting with President Saleh of Yemen ahead of the Parade. Their discussion focused on how the UK and Yemen can work together to address the challenges that Yemen faces, including economic and political reform, as well as security.
Both Prime Minister and President Saleh underlined their strong support for “The Friends of Yemen” process and looked forward to seeing further progress from the forthcoming meeting in September.
The Prime Minister also offered his congratulations to the President on the occasion of his son passing out from Sandhurst.