The visitors pulled one back when Lucas Perez ran on to Miguel Cardoso's pass to score before Alex Bergantinos thumped a superb 86th minute leveler to stun the European and Spanish champion.
Barcelona is now headed to Japan for the annual Club World Cup, taking a break from La Liga action until the end of the month.