BARCELONA, Spain (AP) -- Lionel Messi and Luis Suarez came to Barcelona's rescue Tuesday, scoring late goals to salvage a 4-4 draw at 10-man Villarreal in a thrilling seesaw match that saw both teams give up a two-goal lead.
Messi rifled in a free kick off the upright to make it 4-3 in the 90th minute, and Suarez then shot through the legs of a defender to snatch a point with the last kick of the match.
The draw narrowed Barcelona's lead of the Spanish league to eight points ahead of Atletico Madrid, which beat Girona 2-0 also on Tuesday and visits Camp Nou this weekend.
"Luis is a player who is always in the right place at the right time, and he appeared at the last second to pull out a match that was not going our way," Barcelona coach Ernesto Valverde said. "And Messi, he is a specialist (at free kicks.)"
Messi was on the bench for the first hour but Barcelona still took a quick 2-0 lead.
However, relegation-threatened Villarreal roared back with 19-year-old Samuel Chukwueze leading the way and produced four unanswered goals to come agonizingly close to pulling off the upset. Barcelona's comeback then came after Alvaro Gonzalez was sent off for a second booking in the 86th.
"This was a crazy game," Valverde said. "There were stretches when it looked like we would win easily, then there was a stretch when it looked like they would. Then we managed to turn it around."
Messi's goal was his league-leading 32nd of the season and his sixth from a free kick. He has now scored from free kicks in three consecutive matches after converting set pieces against Real Betis and Espanyol.
SHOOTOUT AT THE CERAMICA
Valverde gave Messi some rest before Saturday's match against Atletico and next week's trip to Manchester United for the first leg of their Champions League quarterfinals.
And at first it seemed Barcelona would stroll to another win at the Estadio de la Ceramica, as the little-used Malcom set up Philippe Coutinho for his first league goal since October. Malcom then headed in a pass from Arturo Vidal to double the lead before Coutinho went close to getting another goal when he hit the post.
But Barcelona ended up missing center back Gerard Pique -- who was rested to avoid any risk of picking up a fifth yellow card that would suspend him for the Atletico visit -- more than Messi.
Chukwueze and Toko Ekambi used their speed to torment center backs Samuel Umtiti and Clement Lenglet throughout the game.
Chukwueze pulled one back in the 23rd and his long pass led to Ekambi leveling in the 50th.
Messi came on in the 61st, but a minute later Vicente Iborra put the hosts ahead after Umtiti had left the back line.
Barcelona goalkeeper Marc-Andre ter Stegen made several excellent saves, but none was better than when he got his fingers on Chukwueze's powerful strike and pushed it onto the bar.
Ter Stegen could do nothing to stop substitute Carlos Bacca from scoring the hosts' fourth with 10 minutes left when Santi Cazorla spotted him running clear behind a struggling Umtiti.
Gonzalez left Villarreal a man down when he got his second yellow card for a senseless foul on Suarez. That cost Villarreal dearly when the team was without a defender in the final moments and failed to stop the double blow dealt by Messi and Suarez, keeping Barcelona unbeaten in 18 straight league games.
Villarreal, which had conceded a 2-0 lead to lose 3-2 at Celta Vigo last round, was left two points clear of the drop zone.
"I don't think we are going down," said Villarreal coach Javier Calleja. "We are going to stay in the top flight playing like we did against Barcelona."
Diego Godin and Antoine Griezmann finally put Atletico past a pesky Girona.
Godin's headed goal in the 76th was initially ruled offside by the referee, but a video review overruled that decision.
Griezmann added a second goal deep in stoppage time with Girona throwing everyone forward in search of an equalizer. The goal ended his seven-match scoring drought.
Also, fourth-place Getafe drew 1-1 at Espanyol.