Blaugrana captain Messi had missed Argentina's midweek friendly with Morocco and revealed he has been managing a pelvic injury since December, but he was available for LaLiga action and typically netted both goals.
The forward carried Barca's chief threat as he moved past Andres Iniesta into second place on the club's all-time appearance list, and produced another moment of pure genius to break the deadlock as his deft free-kick confused Espanyol captain Victor Sanchez so much on the goal-line, he directed the Argentinean's 71st-minute set-piece into his own net.
That mistake cost the visitors a battling point as goalkeeper Diego Lopez excelled, with Messi sealing the points late on as he doubled the league leaders' advantage with a first-time shot past Espanyol's number one.
There was no hint at Messi's ongoing fitness problems as he dazzled from the outset, seeing one close-range effort superbly blocked by Naldo before prompting an attack that concluded with Ivan Rakitic fizzing a shot just wide.
Messi's in-swinging free-kick was then almost deflected past Lopez on the 30-minute mark, drawing a smart stop, while Barcelona supporters shared confused glances when the Argentina international uncharacteristically missed the target as his one-man assault on Espanyol's goal continued.
Barca was dismayed by a couple of refereeing calls early in the second half, with Nelson Semedo denied a penalty, and Lopez again foiled the hosts as substitute Malcom's rising strike was expertly palmed clear.
However, Sanchez's moment of madness saw the Espanyol skipper dive in on Messi just outside the box and then, as the Barca number 10 stepped up, dart back to the goal-line and beat Lopez to the free-kick, awkwardly flicking a header beyond the goalkeeper, who may well have the Panenka-esque strike covered.
A low sweeping finish a minute from the end of normal time from Malcom's pass saw Messi double his and Barca's tally and make the victory safe, taking another step towards the title.