An inspired display from goalkeeper Les Pogliacomi helped secure a shock win for League One Oldham at Boundary Park.
The Latics started brightly and went ahead when Scott Vernon sidefooted the ball in from David Eyres' cross.
Shaun Wright-Phillips' shot was cleared off the line by Eyres before the break and Pogliacomi then took over.
After Kevin Betsy went close with a lob, he produced a string of saves to keep out shots from Antoine Sibierski and Bradley and Shaun Wright-Phillips.
Kevin Keegan handed a first start to Bradley Wright-Phillips but his side were well below par in the early stages.
There could have been a goal after only three minutes when Eyres' corner was completely missed by David James and flew into the net - but it was ruled out for no obvious reason.
Jolted by that, City pushed forward and Joey Barton blasted the ball wide after the Latics defence failed to clear Ben Thatcher's cross.
But Oldham deservedly went in front when Vernon was left with a simple finish after Eyres squared the ball to him from Neil Kilkenny's free-kick.
The same combination produced another decent opening for the home side but Vernon could only shoot straight at James after Eyres' cross.
City finally had a good spell towards the end of the first 45 minutes and Eyres denied Shaun Wright-Phillips an equaliser before Sibierski shot narrowly wide.
Both sides had great chances to score soon after the interval as the game opened up.
Betsy lobbed James but the ball floated just over the bar, while Pogliacomi blocked Sibierski's drive and Paul Bosvelt fired over after a goalmouth scramble.
Bradley Wright-Phillips was then left rueing more heroics from Pogliacomi as his near-post effort was kept out.
Keegan threw on Willo Flood and Steve McManaman in a bid to turn the tie around but it was 40-year-old Eyres who almost capped a superb display with a fierce drive which flew just wide of the far post.
Shaun Wright-Phillips has been the shining light for City this season and he thought he had levelled when he unleashed a curling shot - only for the outstanding Pogliacomi to tip the ball around the post.
City piled on the pressure in the closing minutes but some last-ditch challenges saw Oldham hang on for a famous victory.
Oldham: Pogliacomi, Bruce, Haining, Daniel Hall, Griffin, Eyre,
Hughes, Kilkenny, Eyres, Betsy, Vernon.
Subs Not Used: Bonner, Appleby, Mildenhall, Beharall,
Goals: Vernon 14.
Man City: James, Mills, Dunne, Distin, Thatcher,
Shaun Wright-Phillips, Bosvelt, Barton, Sibierski (Flood 68),
Bradley Wright-Phillips (McManaman 69), Macken.
Subs Not Used: Waterreus, Onuoha, Negouai.
Ref: M Dean (Wirral).