The hosts showed a lot of determination to overturn a one-goal deficit and defeat the Spanish champions.
Pep Guardiola's men pushed for more after the break, but were pegged back by an equalizer from substitute Diego Ifran, and ultimately lost the game after Xabi Prieto found the net from the penalty spot.
The hosts started the game well, defending high up the pitch and pressing Barcelona's midfield before Xavi & co. could muster anything dangerous. Real Sociedad even went close the scoring first as in the 16th minute Raul Tamudo flicked a cross wide of the right post.
However, Barcelona were settling fast into the game and started exerting their trademark passing style. The hosts looked water-tight at the back, but it seemed like a goal was just a matter of time.
The Blaugrana finally opened the scoring near the half-hour mark when Thiago exquisitely lobbed Claudio Bravo after being picked out by Lionel Messi. Barcelona continued to press, but were finding it hard to bypass a tight defensive line by Real Sociedad.
Messi had a decent shot blocked in the 38th minute for what proved to be the final moment of interest in the first half.
Not much changed on the pitch after the restart as Barcelona seemed to be in full control of the game. Still, it was Real Sociedad who got the first chance in the second period when in the 47th minute Mikel Aranburu blasted a shot wide from outside the box.
The tempo of the game began to drop, but Barcelona were still the more active team in attacking sense. Jeffren and Messi went close for the visitors in the following minutes, but both were denied by the excellent Bravo in goal for Real Sociedad.
Messi was at the heart of Barcelona's best attack in the second half when in the 65th minute he collected the ball deep in the visitors' half and raced all the way to Real Sociedad's penalty area before squaring for Ibrahim Afellay, who under no pressure at all send a weak shot right into the hands of Bravo.
Against the run of play, however, the hosts got the equalizer through Ifran. The forward pounced on some hesitant defending by Gabriel Milito and Fontas to stab high into the top right corner from near the penalty spot.
Milito had the ball in the net in the 76th minute with a diving header, but it was ruled out for offside as Barcelona were throwing everything forward in search of the winner. However, they were pegged back six minutes later when Prieto converted a penalty conceded by substitute Javier Mascherano.
Following today's results, Barcelona sit in first place with a eight-point lead over Real Madrid, while Real Sociedad are 12th, two points ahead of Zaragoza. Josep Guardiola's men host Espanyol next Sunday, while Sociedad visit Valencia a day earlier.