The Blues stormed into a first half lead through goals from Vincent Kompany and Ilkay Gundogan and looked all set to clinch the Premier League title.
City had good chances to extend the lead but did not take them and were made to pay.
United hit back with second-half goals from Paul Pogba (two) and Chris Smalling to earn the points.
Guardiola said: “We had a good game in general, especially of course the first half. But it’s boxes, in that level, in that competition, against that rival.
“So when you have the chances you have to score two and it’s possible that we could’ve scored three. Of course you always have bad moments, and we’ve had bad moments the last two games.
“Every time they arrived they scored a goal. When this happens it’s so complicated to win the games. We created enough to score more. Congratulations to United. Now we’re going to try and stand up again and focus on Tuesday.”
READ: City 2-3 United - match verdict
City have endured a tough week, but are still on course for the Premier League title with a 13 point lead and just six games remaining.
There is little time to reflect on this defeat with the return leg against Liverpool in the Champions League quarter-final on Tuesday and a 3-0 deficit to overcome.
“We’re the team who has conceded the fewest goals and other statistics like the fewest chances conceded during the season,” Guardiola said. “When you arrive at that level in important games you have to be solid.
“At Anfield, two times they arrived and during the first 27 minutes they scored two goals. The problem at Anfield was that we didn’t create the chances to punish them, but they didn’t do too much in the second half.
“Today United didn’t have one shot on target in the first half and in the second half they arrived twice and scored two goals.”
The boss added: “The people have said since November and December that the Premier League is done, but it’s a tough tough fight to keep going and keep focusing every weekend.
“In football anything can happen, it’s the first time we’ve lost two games in a row this season and now we have to recover and try again, go back to the basics and win games. We’re going to try on Tuesday and in the next games.”