Mojo Star, a 50-1 chance, took second, with the winner's stablemate Hurricane Lane, another son of Frankel, in third. The runners finished well strung out with Mac Swiney and Third Realm fourth and fifth.
It was a sensational twist for Kirby, who was winning his first Classic after being involved in a jockey-merry-go-round earlier in the week.
The 32-year-old had been set to ride the better-fancied John Leeper in the great race up until midweek - only to be replaced by Frankie Dettori when the latter's intended mount, High Definition, was announced a non-starter.
Kirby's consolation prize - and what a consolation - was the ride on Adayar. Champion jockey Oisin Murphy had been pencilled in to partner the colt, but given Appleby's long-standing relationship with Kirby, riding plans were changed when he became available.
"There's been ups and downs, it's racing, but when it comes to Charlie Appleby, he's a top man," Kirby said. "I can't thank him enough. He's a real gentleman and a great trainer.
"I've always said I'd rather win a Derby than be champion jockey. It's the greatest race, isn't it? I'm lost for words. It's quite unbelievable really - I don't think it's really sunk in yet. I hope my mother was watching!
"He ran well in the Lingfield Derby Trial and that was obviously good form - we can all be wiser after the event. I got in (on the rail) and luckily the horse was brave enough to go through with it - he galloped up to the line and out through it."
Kirby added: "I was asked to ride John Leeper, which was an exciting moment. Five minutes later, Charlie [Appleby] rang me and asked me to ride this lad. I said I'm sorry, I've just put my name to John Leeper. Mr Dunlop said, if you're going to ride him, put your name to him, and I was a man of my word and I did. And it's worked out great that I lost the ride on him!
"I'm not really a person to get overexcited about things, but I was then and it was a real buzz. I hope my kids are watching, and at least they know when they call Daddy an all-weather jockey, he's not an all-weather jockey."
Asked more about the rollercoaster nature of the week, Kirby said: "You wouldn't have wanted to be around me for the first hour of that night, but then I got over it.
“Luckily I spoke to Charlie relatively quickly and, like I said, he had his jockey booked and he was a champion jockey (Oisin Murphy) and he was kind enough to let me ride the horse. Full credit to him - he's a great trainer, a great man and a great father, and I can't thank him enough."
Kirby took him time to come out of the weighing room for the presentation and revealed: "It was a light enough weight for me, and I just wanted to have five minutes to take it in and drink some juice. Mad, crazy - what goes around comes around."
The big disappointment was 6-4 favourite Bolshoi Ballet, who was perfectly placed turning for home but faded to be seventh. It was the fifth time that Ryan Moore had been beaten aboard an O'Brien-trained favourite in the race.
Appleby said: "All the credit goes to Sheikh Mohammed and Team Godolphin. We spoke on Wednesday night after the horses did their breeze in the morning and I'll be honest, I said to His Highness I couldn't be happier with them all, but I did feel this horse was more a Leger horse, and he said 'Charlie, run him, there's only one Derby. As always, he's right.
"He's a big horse and I wouldn't say we're going to rush to anything yet. I think we'll take this on and just sit back - they're nice discussions to have of where we go next."
Appleby believes his first Derby win three years ago with Masar provided some valuable insight ahead of a second success.
He said: "When you're in the position I'm in and have the horses I have in your care, the expectations are always there and when you have your first Derby winner it's a surreal moment and there's also a sort of sense of relief that you've ticked off one of the boxes of what you're employed to do.
"So coming into today's Derby, everyone was a bit more relaxed - but as I always say, unless you've driven a Ferrari you don't know what one is like, and until you've won a Derby you don't really know what sort of horse you need to win a Derby. Thankfully, we're in a position now to learn what horses are needed and we have a great team sourcing horses for us to train."
As Appleby savoured victory, O'Brien, seeking a ninth success in the race, was left reflecting on Bolshoi Ballet's tame surrender and, perhaps privately, the decision to leave his five other possible runners (he had left six in the contest at the five-day stage) back at his Ballydoyle base.
Bolshoi Ballet returned to the unsaddling enclosure with a cut to his hind leg. O'Brien said: "He just ran a bit lifeless. What the reason was, I'm not sure," he said. "It doesn't work every day. That's the way life is.