The Queen Elizabeth-class aircraft carrier was there as part of a programmed logistics visit as she continued training and sea trials.
The 65,000-tonne vessel has been undergoing different simulations to prepare for active deployment and will move on to Carrier Sea Training later this year.
Type 23 frigate HMS Lancaster accompanied the carrier back home.
People gathered along Portsmouth's city walls to welcome HMS Prince of Wales back.
Cover image: HMS Prince of Wales arrives in Portsmouth.