From 7-2 ahead, Selby was pegged back to 8-7 as O’Sullivan – who celebrates his 41st birthday today – staged a tremendous fightback at the York Barbican.
But world champion Selby closed out the match with two centuries – five of the last six frames were 100-plus clearances – to join an exclusive club of winning the World Championship and UK crown in same year.
“I knew I had to be on top of my game tonight,” said Selby, who picked up a £170,000 winner’s prize.
“He threw everything at me and I had to be at my best.
“It’s great to join an elite group of winning the World Championship and UK title in the same year.
“To play Ronnie in any game is always a great atmosphere and gives you a buzz.
“I had to be on the top of my game, and if I had only played at 60 per cent then I wouldn’t have won.
“In my eyes Ronnie and Stephen Hendry are still two of the greatest players to play the game. It is a fantastic feeling to play him in the final.”
O’Sullivan, who had a consolation of £75,000 runner-up prize, first won the UK title as a 17-year-old back in 1993 – the youngest-ever winner beating Hendry 10-6 – and had a proud record going into yesterday’s match of never having lost a UK final.
He went on to reach the UK final in 1997, 2001, 2007 and 2014, and lifted the trophy on each occasion.
So O’Sullivan – who edged out Marco Fu in Saturday’s semi-final – cued off yesterday looking to extend that proud record and started with a century break.
His stylish 124 clearance left world champion Selby – whose only previous UK title came in 2012 – sitting in his chair, yet to pot a ball.
And when O’Sullivan got in the reds in the second frame, another big score looked possible.
But with the black and pink tied up, he was forced to manoeuvre around the table for the blue and faltered on 32.
Selby and O’Sullivan are touted as the master tactician against the swashbuckling rebel and frame two was an intriguing contest with its scrappy nature playing to the world No 1’s strengths.
A hard-earned break of 63, again utilising the blue, nudged O’Sullivan back in front and he should have made it 3-1 – after Selby missed a simple blue – but failed to knock a red into the centre pocket. A relieved Selby – world No 1 for approaching two years – knocked in breaks of 67 and 63 either side of the mid-session interval to go 3-2 in front.
Frame six was a 45-minute feast of tactical play, O’Sullivan looking like he would pinch it when he produced a good snooker on the blue.
Selby left a chance, but the Essex potter surprisingly missed the blue into the centre and his opponent swooped.
It was a painful frame to lose, and O’Sullivan fell 6-2 behind after the first session as Selby knocked in breaks of 58, 41 and 87.
If O’Sullivan was to add to his amazing haul of titles – he has won five World Championships, six Masters and five UK titles – he needed to make inroads into Selby’s lead when play resumed.
But it was the Leicester potter who stretched his lead to 7-2, after an opening 56 break, although this seemed to spark O’Sullivan into life.
He knocked in breaks of 56, 80 and 134 – his 850th career century – to cut the deficit to 7-5.
It was an impressive fightback from the No 8 seed, and lesser men than Selby would have crumbled facing such pressure.
But the 33-year-old showed why he stands at the top of the world rankings, holding his nerve with a clearance of 137 – his first century of the final.
Both players missed long-range reds, before O’Sullivan responded with 130 – his 100th century at the UK Championship.
From 7-2 down, O’Sullivan pulled it back to 8-7 after an 82 break.
But an ambitious brown from O’Sullivan in frame 16 let in Selby who pounced for yet another century – 134 – before clinching victory in style with a 107 clearance.
O’Sullivan said: “Well done to Mark, he was the best player all week.
“I have had a great week.
“I just want to say well done to Mark he played fantastic today, he deserved it.
“I enjoyed today, the crowd have been fantastic. I scored alright but I missed too many easy balls.
“You can’t afford to do that because if you start giving your opponent confidence and easy chances, they’re going to annihilate you.
“I think I’ve done OK considering he’s world No 1and he’s so far ahead of everybody else.”