Barcelona have equalled Real Sociedad's 38-game unbeaten La Liga record courtesy of a 3-1 win over Leganes at Camp Nou on Saturday night.
Sociedad set the record almost 40 years ago, but Barcelona will have the chance to move out on their own when they host Valencia next weekend.
The victory over Leganes, which was earned courtesy of another Lionel Messi hat-trick, has moved Ernesto Valverde's side 12 points clear of second-placed Atletico Madrid, who will travel to the champions Real Madrid on Sunday afternoon.
Barcelona's first half-chance of the night arrived in the 13th minute when Gerard Pique met a cross from the left, but the centre-back's header was high of the Leganes crossbar.
Philippe Coutinho then brought a smart save from Ivan Cuellar four minutes later, before Luis Suarez was denied by an incredible stop from the Leganes goalkeeper in the period of pressure that followed.
Barcelona did make the breakthrough in the 27th minute, however, when Messi found the corner of the net with a wonderful free kick from distance.
Nordin Amrabat was the lone figure in the Leganes attack, and the number seven was finding it difficult to ease the pressure on his side as Barcelona continued to force the issue.
The home side's second arrived in the 32nd minute when Messi collected a wonderful Coutinho pass before sliding the ball into the bottom corner for his 28th league goal of the 2017-18 campaign.
Claudio Beauvue came off the Leganes bench at the interval, and the centre-forward had the first chance of the second period - heading a brilliant Joseba Zaldua cross wide of the post.
Leganes had another half-chance in the 66th minute when Nabil El Zhar met a cross from the left, but the former Liverpool attacker never threatened to test Barcelona goalkeeper Marc-Andre ter Stegen.
El Zhar found the back of the net two minutes later, however, with the 31-year-old's low strike finding a route into the bottom corner via a deflection as Leganes halved the deficit with 20 minutes of football to play at Camp Nou.
Luis Suarez should have put the game beyond Leganes 10 minutes from time when he met a cross from Ousmane Dembele, but the striker fired over the crossbar from close range.
Messi did secure all three points in the 87th minute, however, when the Argentine gathered a cross from Dembele before finishing past Cuellar to complete his hat-trick.
BARCELONA (4-3-3): Ter Stegen; Semedo, Pique, Vermaelen, Roberto (Alba 74'); Coutinho (Iniesta 81'), Rakitic, Gomes; Messi, L.Suarez, Dembele (D.Suarez 88')
LEGANES (4-2-3-1): Cuellar; Zaldua, Bustinza, Siovas, Garcia; Perez (Guerrero 78'), Gabriel; Ramos, Eraso (Brasanac 60'), El Zhar; Amrabat (Beauvue 46')