Gerard Pique was sent off at half time in his final match before retirement for Barcelona as his side came from behind to defeat Osasuna and move five points clear at the top of La Liga.
35-year-old Pique was dismissed despite being on the bench after appearing to remonstrate with the referee.
He was angered by the decision to show Robert Lewandowski a second yellow card in the 31st minute.
David Garcia gave Osasuna the lead, before Pedri drew level and Raphinha completed the comeback with a second half header.
Lewandowski was dismissed for only the second time in his career after he was booked for an aerial challenge with Garcia.
Pedri's equaliser came early in the second half, before Raphinha headed in Frenkie de Jong's cross five minutes from time to ensure Barcelona took full advantage of Real Madrid's loss at Rayo Vallecano on Monday and open a 5-point gap at the La Liga summit.