Portsmouth 2 Manchester City 1
Mendes unleashed his first thunderbolt on the hour and then, with just 20 seconds remaining, hit an unstoppable right-foot strike into the top corner to make Richard Dunne's equaliser irrelevant and leave David James stranded.
Portsmouth were well worth their victory as City justified their reputation for inconsistency.
Pompey manager Harry Redknapp introduced a more attacking formation with Argentinian playmaker Andres D'Alessandro employed behind a front two of Lomana LuaLua and record signing Benjani.
The two front men combined on 16 minutes to set up an early chance for captain Gary O'Neil.
Benjani somewhat fortunately found LuaLua on the right hand touch line with a deflection off the foot of Stephen Jordan, and the DR Congo international sent an inviting cross into the area only for O'Neil to stretch and misplace his header over the bar.
Joey Barton almost embarrassed Matt Taylor eight minutes later when he collected the left-back's weak defensive header, only to fire just wide.
Reinstated Denmark international Brian Priske, making his first start since January, looked to have created another chance for O'Neil when he played a ball inside Micah Richards, but Dunne made ground to make a fantastic last-ditch challenge.
Just minutes earlier Jordan was fortunate not to have been booked for a horrendous two-footed lunge on Mendes, which nearly ended the Portuguese midfielder's afternoon.
With five minutes to go before the interval Benjani capitalised on a poor punch from James from a Sean Davis cross. The Zimbabwean striker evaded Richards but took one touch too many and blasted the ball high and wide, much to the delight of the 1,500 City fans gathered behind the goal.
Visiting boss Stuart Pearce, celebrating a year in charge at Eastlands, sacrificed Trevor Sinclair for youngster Lee Croft to try and stretch Pompey's narrow midfield.
But it was full-back Taylor who nearly created an opener, pushing forward on the left hand side and delivering a deep cross which looked to be heading straight for Davis, but the acrobatic James lunged to flick the ball clear.
Benjani, in desperate need of a goal, turned on the edge of the area on 53 minutes but shot tamely wide as the home support began to resign themselves to another frustrating afternoon.
Mendes, however, had other ideas.
D'Alessandro's corner was headed as far as Mendes who was waiting patiently on the edge of the area, and the Champions League winner took one touch to control and a second to unleash a dipping volley which left James flat-footed and sent Fratton Park into delirium.
Pearce encouraged his team forward and introduced a 3-4-3 formation to push for the equaliser, and seven minutes from time they looked to have dented Pompey's hopes.
A corner from the right hand side was headed first by Richards and then by Georgios Samaras before Dunne nodded home from just two yards out.
As the game drifted towards what looked like an inevitable draw Mendes again hovered on the edge of the area, before tricking substitute Bradley Wright-Phillips and hitting another stunning strike to leave James once more static as the ball sailed into the top corner.