Messi won and then chipped home a free kick from the edge of the box in the 71st minute to open the scoring in a game of few clear-cut chances.
The Argentine then added his second of the match -- and 41st of the season -- when he finished Malcom's cut-back two minutes from time.
Amid concerns over a thigh injury that forced him out of Argentina's friendly defeat to Venezuela, Messi showed Barca fans they have nothing to worry about. This was not the performance of a player struggling through 90 minutes.
Messi's two goals moved Barca 13 points clear at the top of La Liga, pending Atletico Madrid and Real Madrid's games this weekend. With just nine games to go, the finishing line is in sight. Beat Villarreal on Tuesday and Atletico at Camp Nou next Saturday and it's as good as over.
As is often the case post-international break, Barca weren't quite at the races in the first half. Coach Ernesto Valverde will have been disappointed at how they struggled to break down an admittedly well-organised Espanyol. The two Brazilians, Arthur and Philippe Coutinho, also had off days.
Manager rating out of 10
7 -- Valverde's second-half changes had the desired effect. Coutinho looked better in midfield and Malcom had a real impact on the left.
Player ratings (1-10; 10 = best. Players introduced after 70 minutes get no rating.)
GK Marc-Andre ter Stegen, 6 -- A quiet afternoon for the German. When Espanyol did briefly look threatening, Pique and Lenglet were there to snuff out the trouble.
DF Nelson Semedo, 7 -- A really lively first-half performance, linking well with Messi and Rakitic, running at defenders and setting up chances. Hard done by to be taken off.
DF Gerard Pique, 7 -- Joked in the week he's worth more than Espanyol's yearly budget, and Barca's rivals -- whom he loves to wind up -- were unable to make him eat his words. Did well against Borja Iglesias.
DF Clement Lenglet, 8 -- A really good defensive performance. A first-half interception on Borja and a second-half sliding tackle and hooked clearance further boosted his growing reputation at Barcelona. Samuel Umtiti was watching on from the bench.
DF Jordi Alba, 7 -- Another strong performance. Doesn't stop going up and down the left flank.
MF Sergio Busquets, 6 -- Was rarely troubled by Espanyol but did almost put himself in trouble once, giving the ball away sloppily in the first half.
MF Ivan Rakitic, 7 -- An energetic performance in defence and attack. Almost scored, too, but his long-range effort was a whisker wide.
MF Arthur, 5 -- The Brazilian's had a fine first season at the club but he must improve against teams who sit back and shut up shop.
FW Lionel Messi, 9 -- Even before his two goals, Messi was the best player on the pitch. His ability to beat a man and range of passing were superb, perhaps only bettered by his "Panenka" free kick and late clincher. He has now scored 40 goals in 11 consecutive seasons.
FW Luis Suarez, 6 -- Fought off a sprained ankle to make the starting lineup but struggled to find space in and around a congested Espanyol defence.
FW Philippe Coutinho, 5 -- Continues to find life tough out on the left in the absence of the injured Ousmane Dembele. Looked a bit better when he dropped into midfield in the second half.
DF Sergi Roberto, 6 -- Replaced Semedo but didn't offer any more than the Portuguese right-back.
MF Malcom, 7 -- Made an impact off the bench, drawing a good save from Diego Lopez and then setting up Messi's second.
MF Arturo Vidal, NR -- Came on for the final few minutes after returning late from international duty with Chile.