The capital giants entered the clash with Barcelona off the back of a 42-game unbeaten run in the league, but they conceded four unanswered goals in an extraordinary clash in the Spanish capital.
Kylian Mbappe had a goal disallowed in the first half of El Clasico for an offside, before Robert Lewandowski (two), Lamine Yamal and Raphinha all scored to hand Barcelona a 4-0 success in Madrid.
Ancelotti has insisted that it was an even match until the first goal went in, with Barcelona then taking the fixture away from their rivals.
"At 0-0 it was an even game and we played with intensity in the first half. We could have scored, but we didn't. We had our chances to take the lead. After they scored we lost our momentum. Then they had space at 0-2, we had to take risks with one-on-ones at the back and they created several chances on the counter," the Italian told reporters after the match.
Ancelotti: 'Real Madrid will recover from El Clasico loss'
"We looked good in the first half and we have to continue in that vein. We are hurt, it's a hard and difficult moment. I would like to thank the fans because they helped us and pushed us throughout the 90 minutes. We have to keep working. We can't throw anything away just yet.
"The team competed for 60 minutes, but we have to forget the last 30 minutes. It was something special because we wanted to get the game back. The season is long, we can't give up and we have to learn from this defeat.
"We learned from the last one and we can apply the same theory now. Now we have to overcome the deficit because the season is long with a lot of games. We can do better and I'm sure we will.
"We were unable to take advantage of their high pressure. Mbappe came close to scoring, sometimes he was offside, but it's normal with such an outfacing defence. He had three or four chances where he could have scored.
"In the first half we followed the approach we played against [Borussia] Dortmund. We tried to press high, in the end it was difficult for them to come out with the ball and we had chances with Mbappe and Vinicius [Junior]. The idea was to press more and we did that for 60 minutes. It's a tough and difficult moment when you lose and especially when you've gone 42 games unbeaten.
Ancelotti says Los Blancos will "learn a lot of things" from Barcelona defeat
"I've been worried about the defeat. We have to pick ourselves up quickly and correct the mistakes of the second half. We have to keep competing and fighting. We will continue to do so this season as we did last season. In the last defeat against Barcelona with 4-0 we won the league and the Champions League. We won't be far off last season's achievements.
"The defence in the first half was good, positioned and aggressive. When [Luka] Modric came on I decided to play one on one to take a risk, we lost the duels and they scored more goals.
"In August the problem was different because the team lacked intensity and energy. Today they had energy and pressed high. This is the line we have to follow. The problem is that when you concede two goals you have to take risks. We could have opened up the game at 2-1 but it didn't happen.
"The problem was that we didn't continue with the intensity we had in the first half. When they score the dynamic changed and when that happens there can also be a psychological problem."
Real Madrid will be bidding to bounce back from their first La Liga defeat since September 2023 when they head to Valencia in the league next weekend, before hosting AC Milan in the Champions League on November 5.