Substitute James Hook snared Western Province with a late long-range penalty to preserve the British and Irish Lions' winning run in South Africa.
Wales back Hook struck four minutes from time, rifling over a 50-metre strike that thwarted the home side's superb fightback.
The Lions looked in control at 18-9 ahead after tries from man-of-the-match Tommy Bowe and his fellow wing Ugo Monye.
But Western Province kept plugging away as full-back Joe Pietersen's try set up a tense finish.
Pietersen had earlier dropped a goal, as did fly-half Willem de Waal, who also kicked four penalties, yet the Lions did just enough to make it five wins from five a week before the first Test against world champions South Africa.
Flanker Martyn Williams also added a try, while two Stephen Jones penalties and a conversion also contributed towards the victory.
The Lions had expected Western Province to be their toughest opponents so far, and so it proved.
The highlights were another sparkling display by the irrepressible Bowe, while Monye surely did enough to keep world player of the year Shane Williams out of first Test contention.
Martyn Williams and number eight Andy Powell also had their moments, but an ineffective display by prop Andrew Sheridan has probably seen him lose ground.
The Lions had to contend with comfortably the worst weather conditions of their 10-match trip, with a blustery wind and heavy showers blowing in from Table Mountain.
And they were also watched by their biggest crowd on tour - just over 34,000, that included an escalating contingent of travelling fans.
A lively opening saw Western Province move 3-0 ahead after four minutes when De Waal booted a penalty from just inside the Lions' half.
But the visitors quickly drew level when Jones found his range 40 metres out as the game continued at a frantic pace.
The Lions wanted to put pace and width on their game, and Jones kicked them ahead when his second successful penalty went over via the post.
Territorially, the Lions enjoyed a considerable advantage, and they looked to have taken the sting out of opponents who threatened little in attack.
As with the Sharks in Durban on Wednesday night, the Lions were up against dogged opponents, and a well-struck De Waal drop-goal tied it up at 6-6.
Physically, the game was proving exactly the kind of work-out the Lions needed heading into week's opening Springboks showdown.
Western Province enjoyed their best spell of the game midway through the second quarter, and they regained the lead through a drop-goal by Pietersen.
But the Lions produced an immediate riposte, scoring the game's opening try after 28 minutes.
Williams and Powell made initial headway, opening up space for the Lions backs, and they made the most of it.
Crisp passing saw full-back Rob Kearney find his fellow Ireland Grand Slam winner Bowe out wide, but the Ospreys star still had it all to do.
He ducked inside one tackle then finished in style, claiming hs fourth try of the tour and edging the Lions into an 11-9 lead.
But Bowe was not finished, and he smashed through three tackles on a weaving run before floating a delightful pass to Monye, whose finish proved exemplary.
Jones added the extras, making it 18-9 and sending the Lions well on their way in pursuit of maintaining a 100% tour record.
The home side looked to mount one last attack before the break, yet they found it increasingly difficult coping with increasing Lions momentum, although De Waal kicked another penalty.
The Lions made a scrappy start to the second period, handing De Waal two long-range penalty chances, the second of which he accepted, cutting the deficit to just three points.
The tourists needed to regroup, and they stepped up a gear when required.
Livewire scrum-half Harry Ellis sniped away at the heels of his forwards, launching wave after wave of attacks that ended with a concerted forward rumble and a try for Williams.
Jones could not convert, and head coach Ian McGeechan then made three changes approaching the hour mark, sending on hooker Ross Ford, prop Euan Murray and lock Simon Shaw.
The Lions were 3-0 ahead on tries, knowing that one more score would probably finish off the home side, but a De Waal penalty cut the gap to 23-18.
Western Province then drew level through a high-class try by Pietersen, who rounded off a spell off powerful work from the pack.
De Waal missed the touchline conversion, but the score set up a gripping closing 15 minutes, with the Lions hauled back to 23-23.
Kearney limped off after being hurt in the build-up to Pietersen's try, and was replaced by Hook, whose first contribution was to land a long-range penalty chance short.
The Lions had lost their spark and verve, but they suffered two poor decisions against them.
Powell was penalised for a perfectly legal tackle, then Monye was called back after taking a quick throw-in inside his own 22, even though there seemed nothing questionable about it.
The Lions had to dig deep entering the last five minutes, and Hook came up trumps, landing a monster 50-metre penalty to secure the win.Reuse content