Edmund went into the contest having never won a set in three matches against the Serbian, but the British number one was superb as he ran out a 6-3 2-6 6-3 victor.
The 23-year-old was aided by the former world number one struggling with his serve in the opening set, and Edmund took full advantage to move closer to one of the biggest triumphs of his career.
Djokovic improved during the second - breaking Edmund's serve on two occasions - and the 12-time Major winner had the momentum heading into the decider.
However, Edmund saved three break points midway through the set and after striking in the eighth game, he served out to love to complete a famous win.
Edmund will take on eighth seed David Goffin for a place in the quarter-finals.