Britain's Prince William and David Beckham during the global premiere of Netflix's

LONDON (AP) — Prince William, spy extraordinaire?

Kensington Palace officials have revealed that William has spent three weeks working with Britain's secret services to understand how the country's security and intelligence services work. He spent time shadowing the foreign intelligence service MI6, worked with the domestic security service MI5, and finally with GCHQ, the government's secret listening service.

Officials said the prince completed his final day of his work placement at GCHQ on Saturday.

In a statement, William said it was a "humbling" experience working with "people from everyday backgrounds" who cannot tell their family and friends about their secret work and all the stresses they face.

The head of counter-terrorism at GCHQ, who remained anonymous, said the prince "worked exceptionally hard to embed himself in the team."