Messi opened the scoring with a brilliant free-kick at RCDE Stadium on Saturday, with Ernesto Valverde's men looking to open up a three-point lead atop the table.
That goal took him up to 10 for the season in the league, making him the first player to enter double figures in 13 consecutive La Liga seasons.
Messi followed up with another free-kick goal in the 65th minute, his 11th strike of the season and the ninth set-piece he has scored this calendar year in the Spanish top flight, three more than any team in Europe's top-five leagues have collectively managed in 2018. It is the first time in his career he has scored two free-kicks in a La Liga match.
"I try to follow a routine a bit, trying to do it the same way so that it goes well again," Messi told Vamos.
"Other times I have a lot of free-kicks and I do not put them in. I was lucky enough to get two in a row."
The Argentina star finished fifth in this week's Ballon d'Or voting behind Kylian Mbappe, Antoine Griezmann, Cristiano Ronaldo and winner Luka Modric.
The 31-year-old also got an assist in Saturday's clash, setting up Ousmane Dembele with a cross as the French winger doubled his side's lead.
1 - Barcelona's Lionel Messi has scored two direct free-kick goals in a La Liga game for the first time ever. Spectacular. pic.twitter.com/nggxGftamF— OptaJose (@OptaJose) December 8, 2018
Messi almost created another goal when a combination with Luis Suarez saw him send the ball flying into the Uruguayan's path in the box, but his effort hit the post.
It has taken Messi just 17 games in all competitions to get 17 goals and 10 assists as Barca sit top of the domestic table and are through to the last-16 of the Champions League.
With his team three points clear at the top, Messi praised their performance, saying: "We came out very strong to dominate the match from the start.
"We kept the ball, we knew how to take it from the rival and Espanyol, without the ball, they suffer.
"They press high and we were superior at all times."