It could have been worse for Zinedine Zidane's side, with Vinicius' finish in the 89th minute preventing what would have been a damaging defeat after a weekend in which both Atletico and Barcelona had won.
Atletico's victory over Villarreal on Sunday put them six points clear of Real Madrid, an advantage that is now only cut to five ahead of next week's Madrid derby at the Wanda Metropolitano. Atletico also have a game in hand. The result ends Real Madrid's run of five consecutive wins while Portu's brilliant header for Real Sociedad early in the second half was also the first goal conceded by the reigning champions in five games.
It represents a slight shift in momentum, as Atletico bounced back from their recent dip by beating Villarreal in sixth, before their closest challengers dropped points for the first time in a month. Barcelona kept their own resurgence going on Saturday by overcoming Sevilla.
Real Madrid had the better chances in a compelling first half, the best of them falling to Mariano Diaz at the back post but he headed against the underside of the crossbar under pressure from a yard out. Toni Kroos and Marco Asensio both went close but Real Sociedad were dangerous on the break, just unable to find the final pass to make their openings count.
But they made it count 10 minutes into the second half, the ball quickly shifted through midfield and out to the left, where Nacho Monreal had time to launch a cross to the back post. Ferland Mendy looked like he would clear but instead was caught under the ball, allowing Portu to jump and send a brilliant header across Thibaut Courtois and into the net.
Madrid's pressure would come but first Real Sociedad could have made it two, only for Alexander Isak to fall just short of Mikel Oyarzabal's pass into the middle.
Zidane sent Vinicius Junior, Rodrygo and Hugo Duro on and there were chances. Casemiro and Duro both missed headers while Rodrygo skewed wide before Vinicius struck two minutes from time, steering in Lucas Vazquez's cross when given too much space in the box. Duro even had a chance to win it but headed over, Real Sociedad surviving for a deserved point.
Standout matches today