The FTSE 100 Index closed 11.7 points higher at 5165.6, helped by encouraging figures from BP.
This helped the Footsie shrug off the drag caused by weaker bank, pharmaceutical and telecom stocks.
BP ended 3% ahead, up 16½p at 585½p after posting stronger first-quarter profits than analysts in the City had expected.
The figures gave a lift to a sector sent reeling by damaging results from US rival Exxon last week and Shell rose 13½p to 488½p.
The gains accounted for around 20 points on the Footsie but the index was held back by a worse session for other heavyweight stocks.
AstraZeneca suffered further falls, and fell 3% or 104p to £32.15, while GlaxoSmithKline slipped 14p to £16.60.
Of the banks, Barclays was off 12p at 601p, while Royal Bank of Scotland fell 19p to £19.68 and HSBC closed down 1½p at 810p. Lloyds TSB ended the day 1½p higher to 789p after revealing the appointment of former BT man Philip Hampton as its new finance director.
Among the telecoms, Vodafone fell a further ½p to 110¾p while mmO2 dropped ¾p to 43½p and FTSE 250 rival Orange slipped 10p to 395p.
Sage gave a lift to investors with encouraging first-half results after strong sales to existing customers pushed profits up 10%.
Its shares rose 9¾p to 198p and Logica also moved ahead, up 3½p to 317½p. ARM climbed 3½p to 221p.