Ter Stegen; Sergi Roberto, Piqué, Vermaelen, Jordi Alba; Sergio Busquets, Aleñá (Messi, 63'), Arthur (Rakitic, 63'); Dembélé (Malcom, 68'), Luis Suárez y Coutinho.
Cuéllar; Nyom, Tarín, Omeruo, Siovas, Jonathan Silva; Óscar (El Zhar, 85'), Recio, Vesga (Eraso, 85'); Braithwaite (Santos, 77') y En-Nesyri.
1-0 M.32 Dembélé. 1-1 M.56 Braithwaite. 2-1 Luis Suárez (70'). 3-1, (92') Messi.
De Burgos Bengoetxea (Vasco). TA: Braithwaite (7¿), Sergio Busquets (11'), Omeruo (29'), Aleñá (53').
Partido disputado en el Camp Nou ante 50.670 espectadores.
Lionel Messi came off the bench to help Barcelona beat Leganes after a stunning Ousmane Dembele performance was cruelly ended by injury.
Dembele, the star of the first half, opened the scoring with a smart finish after linking well with Jordi Alba.
Leganes struck back after the break when Martin Braithwaite turned home from inside the box, the Danish international adding Barca to his list of victims after scoring against Real Madrid in the week.
However, Messi then came on to save the day -- which was lucky, as the brilliant Dembele had to be taken off with an ankle injury shortly after the Argentine was introduced.
Messi forced Barca's second goal with a fine shot form distance, which Ivan Cuellar did well to save but the Leganes goalkeeper couldn't prevent Suarez from scoring the rebound.
Barca then wrapped up the win in stoppage time via a right-footed strike from Messi as they restored their five-point lead at the top of La Liga.
Ernesto Valverde made changes for the game, opting to rest Messi and Ivan Rakitic, with Thomas Vermaelen and Carles Aleña coming into the side.
The early possession was all Barca's and the limelight was Dembele's. The Frenchman lit up Camp Nou with a series of lighting quick runs which bamboozled the visitors.
He was a deserved first scorer, turning home from 12 yards after getting the ball back from Alba.
Braithwaite's equaliser, with Barca poor at the back, drew memories of the Catalan side's loss at Butarque earlier in the season.
But Messi was on hand to make sure there was no slip-up here as Barcelona kept their tight grip on top spot.