Theresa May has warned the Army's newest officer recruits that challenges posed by terrorist groups and changing international alliances have made the world more complex than ever before.

Speaking as the Queen's representative at the Sovereign's Parade at Sandhurst Academy, the Prime Minister referenced Khalid Masood's deadly attack in Westminster last month.

She also commended former Sandhurst graduate Captain Michael Crofts for tending to the wounded as the day unfolded.

Mrs May said she wanted Britain to build a "new and deep special partnership" with the European Union as the UK enters into negotiations to leave the bloc following the EU referendum last June.

She said: "The world into which you all now enter is also very different from that which confronted many of your predecessors.

"The threats we face today are more complex than ever before. And the missions that you will be asked to undertake will be similarly complex."

Mrs May said the importance of the armed forces remained paramount for keeping Britain safe, "whether it is the Royal Air Force flying missions against Daesh over the skies of Syria and Iraq, the Royal Navy protecting our sea lanes in the Gulf, or the British Army playing a leading role in UN peacekeeping missions in Somalia and South Sudan".

The Prime Minister also restated her commitment to meeting Nato's requirements for investing 2% of Britain's GDP in the armed forces, and promised to do "everything possible" to support military families.

Her reference to RAF missions against Daesh insurgents comes amid heated international discussions over the future of Syria's leadership following a suspected chemical weapons attack by Bashar Assad's regime on April 4.

MPs previously voted not to intervene in the conflict, which entered its sixth year in February.

Sandhurst trains the Army's officers and has previously hosted many famous graduates and members of the Royal Family, including Prince William and Prince Harry in 2005/06.

Other famous cadets who have passed out there include the Sultan of Brunei, Sir Winston Churchill, fascist Sir Oswald Mosley, James Bond author Ian Fleming and actor David Niven.

Theresa May witnessed the ceremony as the Sovereign's Representative while the Queen attended Maundy Thursday celebrations in Leicester.

Watching over the 587 officer cadets on parade from a raised dais, wearing a bright red hat, red heeled shoes, red gloves and a dark blue overcoat, the Prime Minister was greeted by neatly assembled lines of troops assembled for inspection.

During occasional bursts of sunshine on the otherwise overcast day, she was led through each of the lines of cadets, bearing swords or rifles, while a brass band played familiar tunes such as the Star Wars theme in the background.

The event marks only the third year when male and female officers have passed out together at the academy, having previously had separate parades for each sex.

Among the present officer cadets the Prime Minister mentioned as noteworthy graduates was the Prime Minister of Bahrain, Sheikh Khalifah's daughter - the first ever Bahrani woman to gratuate from the Academy.

She also heralded the commission of the first ever female officer to serve in the Royal Tank regiment - a direct result of the decision to enable women to serve in the combat arms and something of which Mrs May said the army could be "incredibly proud".

Women cadets have been on exercise, training and living with their male counterparts since January 2015 in a move designed reflect the modern day-to-day workings of the Army.

Mrs May went on to praise the dedication of the armed forces as a whole and said: "Nothing fills me with more admiration and gratitude than the exceptional commitment of our armed forces - and their families, who are such a critical part of that sacrifice and service to our country.

She continued: "As Prime Minister I want to say very clearly on behalf of the whole country - we will always stand proudly behind you."

Among those commissioned at the event was 23-year-old Alexandra Krause, who said she was excited, rather than concerned, about entering the more complex world of warfare the Prime Minister alluded to in her speech.

She said: "I wouldn't say (I was) concerned much.

"Sandhurst and the army prepare you very well for that sort of thing."

In an official statement after the commissioning ceremony, the Prime Minister also emphasised the role of the armed forces in ensuring continued alliances between each of the members of the UK.

She said: "As they serve our country with the values of courage, integrity, selfless commitment and respect for others, our service men and women are an enduring source of good who help bring us together as one United Kingdom.

"With 14 different countries represented among those graduating, today's event demonstrates Britain's strong partnerships with the rest of the world - and all of those being commissioned into our armed forces will play a leading role in keeping our United Kingdom strong, safe and secure."