Manchester - Sunderland debutant Paddy McNair scored an 87th-minute own goal to earn Pep Guardiola a 2-1 victory in his first Premier League game as Manchester City manager on Saturday.
City took an early lead courtesy of Sergio Aguero's penalty, but they failed to make their territorial dominance count and Jermain Defoe looked to have earned Sunderland a point with a second-half equaliser.
But with three minutes to play, Jesus Navas's right-wing cross was helped on by fellow substitute Kelechi Iheanacho and McNair, who had only come on four minutes earlier, headed the ball into his own net from close range.
The Northern Ireland international signed from City's cross-town rivals Manchester United earlier this week and his unwitting intervention denied David Moyes a creditable point on his bow as Sunderland manager.
City finished the opening day joint-top of the table with Hull City -- surprise conquerors of champions Leicester City -- but Guardiola will have been concerned by his players' struggles to break Sunderland down.
The former Barcelona coach, who started with Willy Caballero in goal in place of Joe Hart, must now prepare his troops for Tuesday's Champions League play-off first leg away to Romanian side Steaua Bucharest.
Guardiola awarded full debuts to centre-back John Stones, his 47.5 million pounds ($61 million, 55 million euros) signing from Everton, and Spanish winger Nolito, who lined up on the left.
He set his team out in a 4-1-4-1 formation, with full-backs Bacary Sagna and Gael Clichy stepping into central midfield and holding player Fernandinho dropping between the centre-backs when City had the ball.
But the most eye-catching element of his first competitive team selection was the inclusion of Caballero, usually City's reserve goalkeeper, instead of Hart.
Guardiola cast doubt on Hart's City future on Friday, amid reports he wants to sign Marc-Andre ter Stegen from his former club Barcelona.
Caballero's distribution was careless, but he made an important early intervention by boxing away a free-kick from Patrick van Aanholt.
Van Aanholt was in the spotlight again two minutes later, but at the other end of the pitch, as his rash sliding challenge on Raheem Sterling gave Aguero the opportunity to put City in front from 12 yards.
Kevin De Bruyne saw a free-kick fisted clear by Vito Mannone, but despite pinning Sunderland back in their own half, the hosts created few chances from open play.
Indeed, had Caballero not produced a smart reaction save to thwart Defoe, Sunderland might have levelled before half-time.
With City continuing to toil in the second half, Guardiola made two changes, sending on Navas and Fabian Delph for Nolito and David Silva.
Wahbi Khazri and Adnan Januzaj came on for Sunderland, the latter roundly booed as he made his debut following a loan move from Manchester United.
Aguero hit a snapshot wide and De Bruyne saw another free-kick repelled by Mannone, before City were hit with a sucker-punch that Guardiola must have feared.
Former City midfielder Jack Rodwell was the architect, releasing Defoe with an incisive pass that afforded the one-time England striker time to drill a shot beneath Caballero.
Guardiola sent for Iheanacho and within seven minutes of coming on he had a hand in the winning goal as his touch from Navas's cross sent the ball cannoning off the hapless McNair's forehead and into the net.