Portsmouth recorded their first win of 2005 in the Premiership, overcoming a goal from Malcolm Christie, the Middlesbrough striker's first since September 2003.
Pompey were a goal behind after 35 minutes but hit back to equalise six minutes later and then grabbed the winner in the 58th minute, although it was some time before the identity of the scorer was confirmed.
Ricardo Fuller drove in a cross from the left and it appeared as if Middlesbrough defender Michael Reiziger had turned the ball into his own net under pressure from Nigerian striker Yakubu Ayegbeni.
Yakubu was happy enough to accept the congratulations of his team-mates whilst Portsmouth fans were just happy to celebrate the winner from whatever source.
Middlesbrough went ahead in the 35th minute with a soft goal which has to go down to a goalkeeping error.
Ray Parlour drove in a 25-yard free-kick which new signing Kostas Chalkias was unable to hold on to, spilling the ball into the path of Christie who made no mistake from six yards.
It was a sweet moment for Christie who was making his first start for 13 months because of two broken legs and numerous other less serious injuries.
Portsmouth were level six minutes later thanks to another goalkeeping error this time from the normally reliable Mark Schwarzer.
Schwarzer was troubled by an innocuous shot from Matthew Taylor and as he attempted to recover from loosing position, the ball was spirited away by Pompey's Aliou Cisse to Taylor, who made no mistake with a rasping right-foot drive into the roof of the net.
Chalkias partially made up for his error by making an important second-half save, racing from his line to block a shot from Christie, who had been played clear of the defence by Jimmy Floyd Hasselbaink.
Then came what proved to be Portsmouth's winner, later given by coach Joe Jordan to his striker Yakubu.
Once Portsmouth had gone ahead Middlesbrough regained control in midfield where Parlour and Boudewijn Zenden were outstanding in an enthralling battle with Portsmouth's Richard Hughes and Cisse.
For the last 20 minutes Middlesbrough pounded the Portsmouth goal without testing the nervous goalkeeper thanks to some brave defending by Dejan Stefanovic and Arjan De Zeeuw. There were bookings late in the match for Parlour and Zenden as frustrations grew.
Yakubu also had justifiable claims for a first-half penalty when he stole in on some hesitancy in the Middlesbrough defence and appeared to be brought down by Reiziger, but referee Phil Crossley waved aside appeals.
Middlesbrough already weakened by injuries to several key players were further hampered when experienced defender Colin Cooper limped out of the action after only 29 minutes, leaving the exposed Gareth Southgate to cope with the Yakubu menace.
McClaren sent on Anthony McMahon in place of Cooper, but then replaced the substitute near the end with Danny Graham as Boro vainly attempted to convert their pressure into an equaliser.