Lionel Messi scored three minutes after coming off the bench as Barcelona came from behind to win at Real Betis.
The home side took the lead in the first half when Borja Iglesias finished from close range after a quick counter.
Messi, rested by manager Ronald Koeman, was sent on in the 57th minute and drove in the equaliser before a Victor Ruiz own goal put Barcelona ahead.
Ruiz headed in an equaliser but Trincao's curled strike sealed the win for the visitors.
The victory moved Barcelona up to second in the Spanish top flight, seven points behind Atletico Madrid, who have two games in hand.