It was Messi's 56th converted penalty in La Liga and saw him draw level with Hugo Sanchez as the league's second-top penalty taker, behind record holder Cristiano Ronaldo on 61.
Barcelona's teenage forward Ansu Fati and all-time top scorer Lionel Messi were on target as they beat bottom club Leganes 2-0 at an empty Camp Nou on Tuesday to maintain their perfect start since the season resumed after its three-month hiatus.
La Liga leaders Barca were far from their best and could have gone behind on two occasions before 17-year-old Fati put them ahead in the 43rd minute, firing through the legs of a defender and into the bottom corner for his fifth league goal of the season.
Messi doubled Quique Setien's side's advantage from the penalty spot in the 69th minute, almost immediately after Antoine Griezmann had a goal ruled out for offside following a VAR review.
It was Messi's 56th converted penalty in La Liga and saw him draw level with Hugo Sanchez as the league's second-top penalty taker, behind record holder Cristiano Ronaldo on 61.
Barca lead the standings on 64 points after 29 games, five ahead of nearest challengers Real Madrid who are in action at home to Valencia on Thursday. Leganes meanwhile are bottom with 23 points.
"It's important to keep winning although we need to play with more speed than we did today but we've got six points and we're going to get better in each game," said Barca midfielder Ivan Rakitic.
"All teams have a lot at stake at this stage so we expected a tough game, they made it difficult for us to find space and they committed a few fouls but things got easier as the game went on."
Barca had enjoyed a dream return to action by thumping Real Mallorca 4-0 while Leganes were beaten at home by Real Valladolid in their first game back but the minnows produced a brave display and should have made more of their bright start.
Barca defender Clement Lenglet had to scramble clear a shot from Leganes forward Miguel Angel Guerrero early in the game and moments later Guerrero struck the post from a tight angle.
Barca's Camp Nou is far from the most atmospheric of stadiums in Spain but this time there were no fans at all to give the team a boost as spectators are currently barred from all La Liga matches for safety reasons due to the COVID-19 pandemic.
The 99,000-capacity arena last stood empty for a league game when Las Palmas visited in a 2017 fixture which was played without fans as a protest against a police crackdown during Catalonia's banned referendum on independence.
Bacca gives Villarreal 1-0 home win over lowly Mallorca
Villarreal kept alive their hopes of claiming a Europa League qualifying berth after a first-half goal by striker Carlos Bacca gave them a 1-0 home win over struggling Mallorca in La Liga on Tuesday.
The result lifted Villarreal two places to seventh on 44 points from 29 games, two behind sixth-placed Atletico Madrid who have a game in hand. Mallorca stayed 18th on 25 points as the defeat dented their hopes of avoiding relegation.
A darting run and cross from Samuel Chukwueze left Bacca with a simple tap-in from two metres at the far post in the 16th minute, after Mallorca's Idrissu Baba had rattled the crossbar with a thunderbolt from 30 metres at the other end.
The lively Chukwueze fired wide after a solo run shortly after the break and visiting goalkeeper Manolo Reina saved a Manuel Trigueros shot before Mallorca missed a gilt-edged chance to equalise.
Substitute Aleksandar Trajkovski's fine footwork and cross left Juan Hernandez unmarked at the far post but the forward sliced his shot wide from six metres with the goal at his mercy.
Home keeper Sergio Asenjo kept out a fierce Ante Budimir shot and Villarreal cleared the ball off the line in the closing stages as Mallorca piled on the pressure but were unable to find a way through.
Ten-man Espanyol cling on for goalless draw at Getafe
Relegation-threatened Espanyol secured a heroic 0-0 draw at Champions League-chasing Getafe on Tuesday after playing most of the La Liga match with 10 men.
Espanyol were almost immediately on the backfoot when defender Bernardo Espinosa was dismissed in the 16th minute for appearing to elbow an opponent while waiting for a cross.
Last week the Catalans had reaped the benefits of Alaves goalkeeper Fernando Pacheco getting sent off in their first game back as they went on to win 2-0 but after finding themselves in a reversal of fortunes in Tuesday's game they coped well.
Espanyol could even have taken the lead later in the first half when Jonathan Calleri combined with Chinese forward Wu Lei but could only fire straight at goalkeeper David Soria.
The numerical difference began to show after the break and Espanyol had to cling on for most of the second period, with keeper Diego Lopez making two big interventions including pulling off a double save in stoppage time to thwart Getafe.
The point took Espanyol off the bottom of the table and into 19th place on 24 points, two points from the safety zone. Getafe remain fifth on 47 as they again missed out on the chance to move into the top four having lost 2-1 at Granada last Friday.
They are level on points with fourth-placed Real Sociedad, who play their game in hand at lowly Alaves on Thursday.
Bayern Munich clinch 8th consecutive Bundesliga crown
Football: 'Player value will fall by 18% post-COVID'
EPL CEO backs 'Black Lives Matter' on team shirts
Do you recognise this man?