Supersub Shola Ameobi fired Newcastle into the last 16 of the UEFA Cup, but for the second week running Sir Bobby Robson's men were pushed all of the way by Norwegian minnows Valerenga.
Anyone who imagined that Valerenga were merely turning up at St. James' Park to make up the numbers were in for a rude awakening. And had it not been for a couple of howlers from their keeper Oyvind Bolthof, Newcastle could easily have faced a third round exit.
Never behind in either leg, United stormed in front from a highly debatable free-kick after 20 minutes only for Valerenga to draw level four minutes later.
Indeed the Norwegians were by the far the better team in the first half as they were sharper to the ball, were more creative and showed a lot more composure than the overrun Newcastle.
A linesman's flag earned United a free-kick on the edge of the area after 20 minutes when Bolthof was harshly adjudged to have stepped from his area when making a clearance.
The keeper though blotted his copy book even further when Alan Shearer's free-kick was hit straight at him and ended up in the net for United's all-time leading European marksman to take his tally to 13 goals and 19 for the season.
The industrious Ardian Gashi almost equalised seconds later, only the brilliance of Shay Given saving the Norwegian international's 23-yard drive that he turned onto the bar.
But from their fourth corner Valerenga did draw level when Titus Bramble was caught ball-watching and big defender Erik Hagen volleyed into the net despite heroics from Michael Bridges on the line.
Sir Bobby threw on Ameobi for Craig Bellamy at half-time and it produced instant rewards with a little help yet again from Bolthof.
Within 70 seconds of his arrival, Ameobi was fed wide on the left and slipped beyond Hagen to drive at goal where his weak shot squirmed through the hands of the crest-fallen Bolthof.
United were then far more composed only to receive a late scare when Bramble missed a right wing cross and Morten Berre volleyed over with only Given to beat.
United handed a debut to 19-year-old Martin Brittain when he replaced Bridges 14 minutes from time.
The tie was eventually sealed after 89 minutes when a long ball down the right touchline from Shearer saw Jermaine Jenas suspiciously offside, but even so he was allowed to continue his run before unselfishly picking out Ameobi to fire across Bolthof from eight yards.