Jermain Defoe's two second-half goals gave Portsmouth their first home win in six months - but not before manager Harry Redknapp had to dump his new 3-5-2 system.
Middlesbrough, with a raft of injured international stars missing, led against the run of play when burly striker Mido slotted in a chance created by Brazilian Afonso Alves.
But in the second half it was virtually a procession to their goal - Defoe passing up a hat-trick of other chances.
Pompey were lucky to survive in the fourth minute when Sol Campbell failed to cut out Didier Digard's cross from the right. Alves was so surprised he forgot to shoot, with only David James to beat.
With the hosts apparently dominating, Mido then caught them cold.
Alves controlled a long ball down the left from Chris Riggott and found Mido with a slide rule pass.
Pompey's defense was slow to cover, and the big Egyptian slipped through neatly past the dozing Younes Kaboul to slot home.
Until then it had needed the cool expertise of young goalkeeper Ross Turnbull - who kept his place despite Brad Jones' return to fitness after a dislocated finger - to keep Pompey at bay.
Wing-backs Glen Johnson and Armand Traore tried manfully to supply service for Defoe and Peter Crouch.
The latter hooked over the bar and shot wide from distance as well as working hard in search of the ball from midfield, while Defoe cleverly found space for himself to dig in a low drive that Turnbull saved at full stretch.
Pompey's three center-backs Kaboul, Campbell and Sylvain Distin were barely troubled by Alves, Jeremie Aliadiere and Mido.
It seemed that Tuncay, injured on international duty with Turkey, was a big miss for the visitors.
But that all changed in the 24th minute when Mido, who started just 10 games for Boro last season following his £6million move from Spurs and a succession of injuries which ended with a hernia operation, hit his fourth in four games.
Frustrated Pompey were repeatedly foiled by Defoe mistiming his runs and being caught offside.
When, in the 27th minute, he managed to get past Robert Huth he was knocked off balance by the big German's challenge - and reacted by charging into his opponent and getting himself booked.
The unexpected setback took much of the spring from Pompey's early stride, and Turnbull was able to distinguish himself with a number of clean catches as the home side tried to put straight balls into the box for Defoe and Crouch.
Turnbull was equal to all they could throw at him in the first half, including palming away from Crouch and Papa Bouba Diop just before the break after his fellow defenders made a hash of Traore's cross.
It was no wonder Redknapp scrapped Pompey's new system at the interval and switched back to the orthodox 4-4-2 - with newcomer Nadir Belhadj and Nigeria winger John Utaka replacing Kaboul and Diop.
The effect was immediate, with Lassana Diarra shooting just too high from 18 yards after Utaka twice split open the Boro defense down the left.
After Defoe had drilled just wide, he finally crowned an intense spell of Pompey pressure by taking Crouch's pass, gliding past a defender and beating Turnbull at his near post.
Middlesbrough players were trying to attract referee Stuart Attwell's attention to the fallen Mido during the build-up to the equalizer, but the goal stood.
Turnbull twice kept Defoe out.
But after each side had been denied a solid-looking penalty claim, it was inevitably the little striker who wrapped up the points.
Johnson headed forward, and Defoe hooked the ball home on the turn.
Boro, without injured internationals Mohamed Shawky and Tuncay as well as tonsillitis victim David Wheater, had taken a pounding in the second half and could not complain about the scoreline - after doing the double over Pompey last term.