Prince William's surprise visit to British troops in Afghanistan drew a mixed response on Wednesday, with some dismissing it as public relations while others praised the future king.

The 25-year-old, who is second-in-line to the throne, spent about three hours on the ground at Kandahar airfield on Monday, meeting personnel and being briefed on operations before returning to Britain, the royal household said.

A spokesperson said the trip was designed to help the young royal familiarise himself with Royal Air Force operations. William, a trained army officer, has been on a four-month attachment with the RAF.

William - who received his pilot's "wings" from his father, Prince Charles, last month - took control of the C-17 Globemaster military transport plane under supervision for a time on the flight.

The defence ministry confirmed that the prince's return flight repatriated the body of a British soldier killed in action on 12 April. He met the soldier's family in private when the plane touched down.

On the visit, former royal protection officer Ken Wharfe suggested the Afghan visit may have been organised to divert attention from negative headlines in recent weeks.

William was criticised for flying military helicopters to attend a bachelor party and landing at his girlfriend Kate Middleton's family home.

"There is an element of risk but there would be no way security officials would allow it to happen," Wharfe said. "It would be pretty well sterile while he was there.

"I'm slightly sceptical about this. I think the cynics amongst us will say it's an attempt to cover up the Chinook jollies."

Leading British publicist Max Clifford also said the trip - nearly two months after William's younger brother, Harry, returned from a 10-week tour of duty in Afghanistan - had been "a good public relations exercise".

"Certainly this will get them some good headlines, I imagine," he told BBC television.

The Stop the War Coalition, which opposes the wars in Iraq and Afghanistan, was more robust in its criticism.

It said the visit was a "shameful waste of public money" and accused defence officials of using British troops in Afghanistan to try to "cleanse" the prince's image. There was a mixed response on the ARmy Rumour SErvice - or ARRSE - a popular Internet forum for members of the British military.

"Smells like a PR operation to me," wrote one poster, calling himself "Devil Dog". "Good for PR, I think", wrote "redgrain", while "OldTimer" added: "He spent THREE HOURS there, at a time when there is a shortage of kit just what did this little PR exercise cost the British tax payer?????"

But "mediumwhiteamericano" disagreed: "it's not about PR; it's all about actually being there, showing the troops that the future King and Head of the Armed Forces cares about the work going on...

"Regardless of the time he spent there, it made a difference."

Like his brother's tour, which attracted similar criticisms but wide praise, William's visit was a closely-guarded secret for security reasons but is a sign he is preparing for his future role as monarch.

William is due to take up another attachment with the Royal Navy at the start of June.

AFP