Barcelona sacked Ronald Koeman after they slumped to their fourth defeat in six games as Radamel Falcao's goal gave Rayo Vallecano a 1-0 win.
Barcelona are ninth in La Liga having only won four of their 10 games, and went down to former Manchester United and Chelsea striker Falcao's first-half goal in Madrid.
Memphis Depay also missed a penalty for Barcelona in the 72nd minute to compound Koeman's misery. The club announced a few hours after the game that the Dutchman had been sacked.
Colombian striker Falcao pounced in the 30th minute after Barca captain Sergio Busquets lost the ball in midfield and allowed Rayo to launch a quick counter-attack that led to the goal.
After dribbling past Gerard Pique, Falcao finished off in style by finding the back of the net.
Barca had a great chance to equalise in the second half but Rayo goalkeeper Stole Dimitrievski saved Depay's penalty.
Sergio Aguero, on his first start for the club, missed a few good chances with one of his best opportunities being a close-range header that just missed the Rayo goal deep into second-half stoppage time.
The result preserved Rayo's unbeaten league run at home this season as they have now won all five of their matches at the Estadio de Vallecas. They are fifth in LaLiga with 19 points from 11 games.
After the game, but before his sacking, Koeman said: "I don't know if my future is in danger. We have players with goals in them. [Sergio] Aguero, [Memphis] Depay.
"It was difficult for us to get into the game, they put a lot of pressure on us. We've been superior. The result isn't fair, but it's there and we can't change it.
"The game we lost today isn't a problem of attitude or play. The team's level has dropped. We've lost very effective players, which also counts."
Following Sunday's 2-1 defeat by Real Madrid in El Clasico, footage posted on social media showed Koeman's car being surrounded by fans as he drove away from the Nou Camp.
In response, Barcelona posted a statement on their official Twitter account which read: "Barcelona publicly condemn the violent and disdainful acts that our manager experienced when leaving the Nou Camp.
"The club will take security and disciplinary measures so that such unfortunate events do not happen again."
October 30: Alaves (H) - La Liga, 8pm
November 2: Dynamo Kiev (A) - Champions League, 8pm
November 6: Celta Vigo (A) - La Liga, 3.15pm
November 20: Espanyol (H) - La Liga, 8pm
November 23: Benfica (H) - Champions League, 8pm
November 28: Villarreal (A) - La Liga, TBD
Real Madrid held by Osasuna
Real Madrid capped a day of topsy-turvy results when they were held to a goalless draw by Osasuna.
Three days after eclipsing rivals Barcelona in the season's first Clasico, Real failed to reproduce the fireworks against high-flying Osasuna.
The team from Pamplona keep on defying the odds and are now sixth in La Liga, only two points behind Real, Sevilla, Betis and Real Sociedad, the four clubs tied on 21 points. Osasuna also sit four points above Barcelona, who slumped to their second successive league defeat on Wednesday following a 1-0 loss to Rayo Vallecano.
Real were repeatedly frustrated by Osasuna, who played with 11 men behind the ball as they focused all their energy on blocking their opponents from scoring and their gamble paid off as they left the Santiago Bernabeu Stadium with a valuable point.
Despite dominating the game with 76 per cent of ball possession, Real failed to break the deadlock. Osasuna, who have only lost twice in 11 league games this season, are now unbeaten in their last five La Liga matches.