Ernesto Valverde was reminded of Barcelona's defeat to Leganes earlier this season during their last-gasp LaLiga win over Rayo Vallecano on Saturday.

The Catalan giants looked set for a repeat of that reverse against Leganes when Jose Pozo and Alvaro Garcia cancelled out Luis Suarez's early opener.

They produced a stirring comeback, though, with Ousmane Dembele drawing them level in the 87th minute before Suarez delivered the decisive blow three minutes later.

Barcelona were off the pace for long periods of the game and Valverde admits there were similarities to the surrender at Butarque in late September – the champions' only defeat this season.

"The ghost of Butarque appeared everywhere in moments in that second half," Valverde said in his post-match media conference.

"But, in the end, we won by playing doing something different.

"When you play against a team who have turned the score around, a precedent always comes to mind and Rayo played and fought and did a lot of things well."

Dembele was introduced for the ineffective Rafinha early in the second period and, despite struggling to get into the game, made a telling impact with his late leveller.

"We expect a lot from him," Valverde added. "Dembele can be decisive and today he helped us with a great goal that allowed us to get the next."

Suarez scored a hat-trick in last weekend's 5-1 thumping of bitter rivals Real Madrid and the Uruguayan concedes that Barca may have have underestimated their struggling opponents, who remain 19th.

"It may be that there was an excess of confidence," he said. "We also have to give credit to the opponent, who are in need of points. The important thing was that we turned it around and got the three points. Now we have to evaluate."