Messi placed fifth in this week's Ballon d'Or voting, the first time he has been outside the top three since 2006, but offered a timely reminder of his enduring brilliance at RCDE Stadium.
The five-time Ballon d'Or winner was inspirational for Barca, opening the scoring with an unstoppable free-kick, then setting up Ousmane Dembele for a superb curling finish.
Dembele sent Luis Suarez clear for Barca's third before half-time with Messi adding his ninth free-kick goal in LaLiga in 2018 after the break to wrap up a completely dominant derby victory.
Barca led in the 17th minute thanks to the first moment of Messi magic in an astounding display.
The Barca captain, playing in this fixture for a joint-record 32nd time, beat Diego Lopez with a perfect free-kick from 25 yards that curled away from the goalkeeper's despairing dive.
Messi was leading Espanyol a merry dance and he set up Barca's second in the 26th minute, twisting and turning defenders on the edge of the box before slicing the back four open with a fine pass for Dembele, who cut inside and fired across Lopez into the top-right corner.
Suarez and Messi hit the post in quick succession as Espanyol completely failed to cope with Barca's attacking movement and sublime passing, a third goal arriving before the break.
Dembele was the creator this time with a superb pass to Suarez, who slipped his finish through the legs of Lopez from a tight angle.
To its credit Espanyol started the second half on top but they could do little to stop Messi, who beat Lopez again with another unbelievable free-kick in the 65th minute, this time from 30 yards.
Oscar Duarte saw a consolation goal ruled out for offside by VAR when he volleyed in Sergio Garcia's free-kick, with Espanyol at least able to restrict the damage to a four-goal defeat.