Andres Iniesta came in for the 2-0 win which saw goals from Luis Suarez and Jordi Alba.
Messi hit the woodwork later in the game, as did Eibar's Fabian Orellana who was sent off with 25 minutes remaining for a second booking.
Meanwhile, Sevilla on Saturday pulled off their second victory in a row, defeating Las Palmas 2-1 in the 24th round.
Messi collected the ball just inside the Eibar half, and looked up before playing a crossfield pass in front of the high defensive backline to pick out Suarez on the right.
Alba's goal, which he celebrated by sucking his thumb in dedication to his new-born son, sealed Barca's first win in three games after surprise successive draws against Espanyol and Getafe, which had cut their lead at the top of the league from 11 to seven points.
After ending a run of back-to-back draws, Barca moved 10 points clear of second-placed Atletico Madrid, who are scheduled to host Athletic Bilbao on Sunday.
The Belgium worldwide was making his 13th consecutive appearance - his longest run of games since joining Barca from Arsenal in 2014 - when he picked up the injury against Real Betis in January.
Barcelona have named a 21-man squad for Tuesday's Champions League game against Chelsea, with just Nelson Semedo and Philippe Coutinho missing.
"We have been analysing this team for a long time; we started one month ago and analysed this team".
"It was a very hard match just as we expected, and we will try and make sure it helps us, although the Champions League is another competition altogether".
Two late goals gave Valencia a dramatic win away to bottom of the table Malaga.
Nigerian forward Brown Ideye gave struggling Malaga a surprise lead in the 27th minute against Marcelino's side and they looked on course for a first league win since 10 December but Francis Coquelin equalised in the 80th minute and captain Dani Parejo netted the victor from the penalty spot in the 85th.
Las Palmas got into the game with an 82nd minute penalty scored by Calleri and were denied an equalizer in injury time when Alejandro Galvez had a goal incorrectly ruled out for an offside which didn't exist.