The Argentine was in indomitable form as he inspired the Blaugrana to an impressive victory over their local rival in his coach's final home game.
Four goals from Lionel Messi, taking his tally to 50 in this Liga campaign, were enough to ensure that bragging rights stayed with Barca once more. A superb free kick and a wonderful cross-goal shot were separated by two penalties for the Argentine who is now almost a certainty for the Pichichi award.
Emotions were running high around the stadium before kickoff with every Blaugrana looking to pay homage to Barca coach. They began the game in a typically free-flowing manner and they were ahead in the 12th minute.
Messi won a free kick 25 yards from goal and got up to take it himself. From a right-of-center position he bent the ball on goal and despite it taking a nick of Raul Baena, his effort flew just inside the post.
For its part Espanyol was doing its best to keep Barcelona's passing as far away from the final third as possible and the home side was struggling to get a sight of goal.
Before the break Espanyol keeper Cristian Alvarez was forced into two vital stops to keep his side within touching distance of Barca. First, he smothered the ball at Seydou Keita's feet as the Malian looked to round him in the area, then he got a strong hand to deny Andres Iniesta from a free kick.
Time to say goodbye | Camp Nou faithful declares "We love you, Pep!"
Barca shifted to three at the back for the second half, allowing Adriano to play further up as the team looked to unlock a stubborn Espanyol side.
The move began to reap rewards as the home side asserted its dominance in the middle of the park. The Blaugrana were awarded a penalty in the 64th minute after a handball in the area by Cristian Gomez. Messi converted via the post to score his 70th goal in all competitions this season.
Juan Forlin tested Jose Pinto with a sweetly-struck volley, but soon after Barca extended the lead and it was the imperious Messi who was on target again for his eighth La Liga hat trick this season. The Argentine latched onto Adriano's pass and his great first touch took the ball away from Victor Sanchez and he arrowed his shot across goal and into the bottom corner.
It did not stop there. With 79 minutes on the clock the home side was awarded another penalty when Sergio Busquets was brought down in the area. The ball was handed to Messi and he dispatched the spot kick before going on to celebrate his 50th Liga goal with Guardiola.
The Argentine almost added a fifth in the dying moments but his dink over Alvarez dropped just the wrong side of the post. Nevertheless Guardiola will have been happy to have ended his current spell at Barcelona in front of the home fans with such an imperious display, condemning the team's city rival to mid-table obscurity in the process.