Real Sociedad have climbed out of the relegation zone in La Liga having beaten 10-man Atletico Madrid 2-1 this evening.
Diego Simeone's men made a lively start to the match, and immediately caused problems in Sociedad's final third.
They almost fashioned a half-chance for themselves as a loose clearance from Enaut Zubikarai was met by Arda Turan, but the midfielder failed to find the run of Raul Garcia.
The warning signs were there for Sociedad and they eventually went behind when Mario Mandzukic tapped in Garcia's cross minutes later to give his side the lead.
An immediate response from the visitors came in the form of Carlos Vela, who curled a superb effort into the bottom corner to draw the two teams level.
Vela then went down in the area for what looked like a certain Sociedad penalty but the referee disagreed and the Mexican was booked for a dive.
The grievance seemed to spur the hosts on and they were unlucky not to take the lead when a mistake from Miranda presented the ball to Imanol Agirretxe, who went round Miguel Angel Moya before Diego Godin cleared his shot off the line.
A dramatic start to the second half then saw Guilherme Siqueira sent off after he received two yellow cards in the space of two minutes to leave Atletico with an uphill task going into the final stages of the game.
The away side continued to threaten, however, and they really should have scored a second goal when Mandzukic fired past the post after being played in by Cristian Ansaldi.
Sociedad punished them for the missed chance as Agirretxe headed home Joseba Zaldua's ball into the box to give his side just their second league victory of the season.