Lionel Messi came off the bench to haul Barcelona back from a goal down against Real Betis to win 3-2 but it was winger Francisco Trincao who snatched victory by choosing the perfect moment to score his first goal for the club.
Barca coach Ronald Koeman took the surprising decision to leave Messi and the in-form Frenkie de Jong out of his starting lineup, perhaps with next week's Copa del Rey semi-final first leg at Sevilla in mind, and saw his side fall behind to a Borja Iglesias strike on the counterattack in the 38th minute.
Messi levelled for Barca in the 59th, less than two minutes after coming on, and then helped his side find a second goal by releasing Jordi Alba with a sumptuous pass which led to Betis defender Victor Ruiz sending the ball into his own net.
- Barcelona ratings: Messi 8/10, Trincao 7/10 for super-sub efforts
Ruiz made amends by powering in a header from a Nabil Fekir free kick in the 75th minute but Portuguese Trincao had the final say, smashing a shot from just inside the box in off the crossbar in the 87th to finally get off the mark for Barca in his 17th appearance in all competitions.
"I didn't need to score for my own good but you have to help out when you can and I'm very happy that we managed to get the win," Trincao told reporters.
"My teammates have always encouraged me and they all congratulated me on the goal."
Barca, who have won their last six league games, are second in the standings on 43 points, seven behind leaders Atletico Madrid who have two games in hand.
The Catalans also pulled off an impressive comeback win against Granada in a Copa del Rey quarter-final tie on Wednesday, clawing their way back from two goals down to win 5-3 in extra-time.
Barca defender Ronald Araujo was forced off in the 12th minute with an ankle problem and Koeman took another unorthodox move by sending on De Jong, who has recently reinvented himself as an attacking midfielder, to deputise at centreback.
The Catalans produced another chaotic display in defence but compensated thanks to their star-studded attack, particularly after Messi and Trincao came on in a double change from Koeman.
"We changed our attitude in the second half and that was the most important factor in getting the victory," added Trincao.
"In the first half we were a little fearful and we didn't take many risks."