Edmund had never won a set in his previous three matches against Djokovic but deservedly came out on top in a high-quality contest lasting an hour and 42 minutes.
The 23-year-old crucially saved three break points in the deciding set to seal a 6-3 2-6 6-3 victory and set up a clash with eighth seed David Goffin in the last 16.
Edmund made the ideal start with a break of serve in the opening game of the match and although Djokovic immediately hit back, Edmund broke twice more to take the first set.
Djokovic looked to be getting back to somewhere near his best as he took the second set in style to set up a decider, but Edmund recovered from 0-40 down in the fifth game to remain in front and then claimed the decisive break before nervelessly serving out for the match.
“It was a great experience first of all to beat Novak, I’ve lost to him three times,” said Edmund.
“He’s a legend of the game so your first match when you share the court is an experience, but now, especially after reaching the semis of the Australian Open, it’s time to try and beat these guys and I was very pleased today how I managed my game, especially in the third set.
“After Australia I got a little bit ill and didn’t have a great run of results until I reached my first final [in Morocco] so it’s nice to come out here and beat a top player like Novak.
“I knew rallying with him and trying to beat him at his own game I wasn’t going to win, so it was important for me to go out there and be expressive.”
The win is likely to take Edmund inside the world’s top 20 for the first time next week, and he added: “After the Australian Open it was a goal of mine to get inside the top 20, there’s no reason why I couldn’t.
“You have to set targets and I thought that was a very realistic target, so I’m pleased it’s happened. But you know the way the tennis world works, you reach a target but it doesn’t stop and you keep trying to get better.”