The ship sailed into Portsmouth Naval Base on Saturday morning.
The 65,000-tonne warship sailed into Portsmouth Naval Base, Hampshire, på lørdag, having operated alongside Spain’s aircraft carrier in the Gulf of Cadiz.
A navy spokesman said: “The Nato task force – made up of 20 ships from six nations – was assembled to show the alliance’s commitment to the region’s prosperity and security ahead of the Nato Madrid summit.
“HMS Prince of Wales was involved in her role as Nato’s command ship, which means she is ready to deploy quickly in response to crises as part of the alliance’s response force.”
The naval exercises began with a royal salute from the Spanish fleet to King Felipe VI of Spain, who was aboard aircraft carrier Juan Carlos I.
Captain Richard Hewitt, commanding officer of HMS Prince of Wales, sa: “Being able to formally recognise the Spanish royal family, saluting King Filipe VI from the bridge of HMS Prince of Wales, was a real honour.
“Coming only a few weeks after our celebrations for our Queen’s Platinum Jubilee, operating alongside the Spanish flagship represents another milestone in the operational journey of HMS Prince of Wales.”