Ilkay Guendogan scored twice and Kevin De Bruyne netted a superb free kick in a magnificent display from the home side that ended Barcelona's 100 percent record and made handsome amends for City's 4-0 drubbing at the Nou Camp two weeks ago.
Guardiola's men now have seven points from four matches, two behind leaders Barca. Borussia Moenchengladbach are on four points after drawing 1-1 with bottom club Celtic.
City's victory looked unlikely when Lionel Messi followed up his hat-trick in the game at the Nou Camp with a dazzling opener on the counter attack in the 21st minute and Barca were in control before Guendogan cashed in on a Sergi Roberto mistake.
In a game peppered with fine attacking and dubious defending, City then ran Barca ragged as the exceptional De Bruyne netted in the 51st minute before helping set up Guendogan's second after 74.
City's best Champions League night left Barca frustrated as they failed to gain the win that would have sealed their place in the knockout stages for a 13th successive season.
The home side's big night started brightly as Raheem Sterling appeared to be brought down in the box by Samuel Umtiti only to be booked, harshly perhaps, for diving.
Then, in a devastating counter attack initiated by Javier Mascherano when he broke up a City thrust in his own box, Messi found Neymar on the left before marauding down the field to latch on to the Brazilian's pass and claim his 90th Champions League goal.
Barca looked poised to take over, threatening a second goal until Sergi Roberto stroked a pass carelessly across his own defensive line, allowing Sergio Aguero to intercept and feed Sterling who crossed for Guendogan to tap the ball in.
[caption id="attachment_27709" align="aligncenter" width="640"]
Manchester City's Ilkay Gundogan scores their third goal against Barcelona Reuters
A poor touch from Sterling stopped him putting City ahead at the start of the second half but they did not have to wait long to go ahead as De Bruyne's free kick dipped over the wall and beat the despairing dive of Marc-Andre ter Stegen.
De Bruyne came close to adding to the lead as the hosts flooded forward. Barca should have equalised when a stray back pass from John Stones led to Andre Gomes hitting the bar when it seemed easier to score.
City, though, earned reward for their domination and some wayward defending by the visitors when De Bruyne's pass cut them apart and set up Jesus Navas to whip in the cross that eventually fell to Germany midfielder Guendogan who hammered his fourth goal in two games.
GROUP C RESULTS
Manchester City 3
Guendogan 39,74, De Bruyne 51 Barcelona 1
Borussia Moenchengladbach 1
Stindl 32 Celtic 1
P W D L F A Pts
4 3 0 1 14 4 9
2 Manchester City
4 2 1 1 10 8 7
3 Borussia Moenchengladbach
4 1 1 2 4 7 4
4 0 2 2 4 13 2
Arsenal earn comeback win to reach knockout round
Mesut Ozil scored a superb late winner as Arsenal hit back from two goals down to beat Ludogorets 3-2 on Tuesday and secure their place in the last 16 of the Champions League with two games to spare.
The North London club, who reached the competition's knockout stages for a 17th time in a row, and Paris St Germain, who also qualified after a 2-1 away win over Basel, are joint top in Group A with 10 points from four matches. Ludogorets and Basel have one point each.
Unmarked Brazilian Jonathan Cafu opened the scoring for Ludogorets from close range with his second goal in the Champions League, giving Arsenal keeper David Ospina no chance from a precise Wanderson free kick.
Three minutes later, Cafu dribbled past Kieran Gibbs and delivered a tempting cross for Romanian striker Claudiu Keseru, who doubled Ludogorets's lead to send the home fans at the Vasil Levski stadium into dreamland.
Granit Xhaka, who returned to Arsenal's starting line-up after serving a domestic ban, reduced the deficit midway through the first half with Ozil turning provider.
French striker Olivier Giroud made it 2-2 three minutes before the break after getting to the ball ahead of keeper Milan Borjan from Aaron Ramsey's cross and flicked home a header.
[caption id="attachment_27711" align="aligncenter" width="640"]
Arsenal's Mesut Ozil scores the wining goal against PFC Ludogorets Razgrad Reuters
Ludogorets almost restored their lead in the second half but Ospina did well to parry Wanderson's shots on two occasions. However, Ozil, who scored a hat-trick in Arsenal's 6-0 win over Ludogorets two weeks ago, had the final word.
Ozil collected the ball in Ludogorets's half, lifted it over an advancing Borjan before slipping past two defenders and calmly slotting into an empty net.
PSG snatch last-gasp win and knockout stage place
Thomas Meunier volleyed a spectacular last-minute goal to give Paris St Germain a 2-1 win at FC Basel, which took them into the last 16 of the Champions League on Tuesday.
PSG had taken the lead with a Blaise Matuidi goal two minutes before halftime but Basel rattled the Ligue 1 champions when Luca Zuffi equalised out of the blue in the 76th minute.
In a dramatic finale the Swiss champions had midfielder Serey Die sent off for a second yellow card following a foul on Marco Verratti and could have snatched a win seconds before Meunier's strike.
PSG, quarter-finalists last season, have 10 points from four games in Group A alongside Arsenal, who also qualified. Basel have one point and were eliminated alongside Ludogorets.
PSG dominated the first half and went ahead when Meunier drove a fierce shot at goal which Matuidi flicked into the net from close range.
The visitors had enough chances to settle the game, but instead Zuffi collected a throw in around 30 metres out and launched a looping effort towards goal which flew over a startled Alphonse Areola and into the net.
Basel went agonisingly close to scoring a second when a free kick flew across the PSG goal and found Marc Janko unmarked at the far post, but he failed to make proper contact.
Seconds later, a PSG cross found Meunier who, having missed two easier chances, met the ball with a thumping volley which swerved past Tomas Vaclik and into the top corner.
GROUP A RESULTS
FC Basel 1
Zuffi 76 Paris St Germain 2
Matuidi 43, Meunier 90
Cafu 12, Keserue 15 Arsenal 3
Xhaka 20, Giroud 41, Ozil 87
P W D L F A Pts
4 3 1 0 12 3 10
2 Paris St Germain
4 3 1 0 9 3 10
3 FC Basel
4 0 1 3 2 8 1
4 0 1 3 4 13 1
Salvio penalty hands Benfica victory over Kiev
Benfica's Eduardo Salvio converted a penalty and Dynamo Kiev missed one as the Portuguese side won 1-0 on Tuesday to go level on points with Napoli at the top of their Champions League group.
Salvio put Benfica ahead in first-half stoppage time when he scored from the spot, as he did in their 2-0 win away to the same opponents two weeks ago, after Luisao had been hauled down by Domagoj Vida when he tried to connect with a free kick.
The goal was just reward for Benfica after they had created several clear chances in the first half.
Goncalo Guedes nearly extended Benfica's lead early in the second half when he rattled the crossbar, but the Eagles appeared to blow their chance when goalkeeper Ederson rashly upended Derlis Gonzalez in the 67th minute.
Ederson, however, atoned for his error by diving to his right to deny his fellow Brazilian Junior Moraes from the spot.
Benfica have seven points from four games in Group B alongside Napoli and one ahead of Besiktas while Dynamo have one.
Napoli's Captain Fantastic Hamsik denies Besiktas
A stunning strike from Marek Hamsik cancelled out Ricardo Quaresma's penalty as Napoli forced a 1-1 draw at Besiktas on Tuesday to stay on course for the last 16 of the Champions League.
Portugal winger Quaresma crashed the ball in from the spot in the 78th minute after Nikola Maksimovic handled. Visiting captain Hamsik then levelled four minutes later with a rasping drive from outside the area.
Napoli dominated possession and could have avenged their 3-2 defeat by Besiktas two weeks ago but Lorenzo Insigne and substitute Dries Mertens fluffed chances in injury time.
The Italians have seven points from four games in Group B, level with Benfica who beat Dynamo Kiev 1-0. Besiktas are in third place on six points while Kiev are bottom with one.
GROUP B RESULTS
Salvio 45+2(pen) Dynamo Kiev 0
Quaresma 79(pen) Napoli 1
P W D L F A Pts
4 2 1 1 9 7 7
4 2 1 1 6 5 7
4 1 3 0 6 5 6
4 Dynamo Kiev
4 0 1 3 2 6 1
Griezmann's late goal takes Atletico through to last 16
Antoine Griezmann struck two goals, one in the 93rd minute, to give Atletico Madrid a 2-1 Group D win over Rostov on Tuesday that took them into the Champions League last 16 and preserved their 100 percent record.
Griezmann joined Atletico's top 10 scorers in European competition by putting the home side ahead in the 28th minute with an improvised volley.
[caption id="attachment_27713" align="aligncenter" width="640"]
Atletico Madrid's Antoine Griezmann scores the winning goal against Rostov REUTERS
Sardar Azmoun levelled barely two minutes later, becoming the first player to score against Diego Simeone's side in the competition this season.
Atletico's passage to the last 16 was guaranteed nonetheless by Bayern Munich's 2-1 win at PSV Eindhoven but Griezmann beat the offside trap in the dying seconds to ensure last year's runners-up held on to their perfect record.
Atletico top Group D on 12 points, Bayern are second on nine, while Rostov and PSV, with a point each, will compete for third place and a spot in the Europa League.
Bayern book berth in last 16 of Champions League
Two goals from Robert Lewandowski allowed Bayern Munich to make sure of progress to the knockout phase of the Champions League as they came from a goal down to beat PSV Eindhoven 2-1 away on Tuesday in their Group D clash at the Philips Stadium.
Lewandowski twice struck the woodwork before equalising from the penalty spot and then steering home a superb 73rd-minute winner as Bayern advanced to nine points, second in the group standings with two rounds to play.
Atletico Madrid top the standings on 12 points with Russian club Rostov and PSV both on one point from four matches.
The Polish international turned home a square ball from David Alaba for the winner, showing a deft touch and superb skill to steer the ball into the net. Alaba had made a defence-splitting run to set up the chance.
Lewandowski had tucked away Bayern's first goal after 34 minutes from the penalty spot after a handball by PSV midfielder Andres Guardado.
[caption id="attachment_27714" align="aligncenter" width="640"]
Bayern Munich's Lewandowski shoots on the goal of PSV Eindhoven's Remko Pasveer REUTERS
The home side, who needed to win to keep alive slim hopes of repeating last year's feat of reaching the last 16, were controversially ahead after 14 minutes.
Television replays showed defender Santiago Arias to be offside as he reacted quickest to Manfred Neuer's parry from a Davy Proper close-in header.
But the linesman's flag stayed down to the delight of the home fans, hoping their side would be able to turn the tables on a Bayern team who easily beat PSV 4-1 in Munich a fortnight ago.
GROUP D RESULTS
PSV Eindhoven 1
Arias 14 Bayern Munich 2
Atletico Madrid 2
Griezmann 28,90+3 Rostov 1
P W D L F A Pts
1 Atletico Madrid
4 4 0 0 5 1 12
2 Bayern Munich
4 3 0 1 11 3 9
3 PSV Eindhoven
4 0 1 3 4 9 1
4 0 1 3 3 10 1