The showpiece contest was won by Masar under Northern Racing College graduate William Buick who was recording the biggest win of his career and enjoying quick consolation for Wild Illusion’s Oaks defeat 24 hours earlier.
It was also a landmark first Derby victory for Sheikh Mohammed and his Godolphin operation.
However Dee Ex Bee, trained at Middleham by Mark Johnston, ran a mighty race under Silvestre de Sousa.
With hot favourite Saxon Warrior boxed in, Dee Ex Bee was perfectly placed in home straight before Masar, trained at Newmarket by Charlie Appleby, swooped.
Johnston’s horse just held off Dante winner Roaring Lion in the battle to finish runner-up and Yorkshire’s best result in the Derby since Karl and Elaine Burke’s Libertarian, ironically ridden by Buick, was second in 2013.
Dee Ex Bee’s owner, Sheikh Hamdan, is the son of Sheikh Mohammed who could not contain his glee as his Royal blue colours were carried to glory.
Sheikh Mohammed said: “It’s not easy to win the Derby, but we have won it. We are pleased to be here today.
“Charlie Appleby is a very good trainer and the horse came from Dubai.”
He added: “I was jumping up and down in the final furlong.
“Horses are in my blood, I love them.”
Appleby said: “It’s not sunk in yet. It still feels a dream.
“I’m delighted for His Highness Sheikh Mohammed. Firstly for giving me the position to be here. I’ve always said when I started this job I wanted to be the first person to have a Derby winner in Godolphin blue.
“It’s a fantastic team effort, Brett Doyle rides him every day and has been sweet on him since the Guineas. He said he would stay and William has given him a peach of a ride.”
He added: “The last 100 yards felt a long way! It’s just great. To have a Derby winner for Godolphin is fantastic.”
Buick was embraced by the vanquished jockeys, saying he had dreamt of this moment since he first started riding in his native Norway.
Saxon Warrior could only finish fourth, dashing dreams of becoming the first Triple Crown winner since Nijinsky in 1970.
On Dee Ex Bee, the aforementioned Johnston suggested Doncaster's St Leger could be the ultimate objective.
He said: ""We came here with doubts about his effectiveness on the track and I'm not sure it suits.
"Because of the camber he rolled on to the one on his inside, but he rallied again up the hill so it bodes really well for the future.
"You could go to the Irish Derby, but I've said before that I don't think I've ever had a horse more suited to the St Leger, so I think it could be best to work backwards from that.
"He's still a big baby and probably the biggest horse in the field, everything suggests there should be better to come."