The loss ends Medvedev's chances of overtaking Rafael Nadal for the world number two ranking while Lajovic records his first top ten win in almost two years.
Serb plays clean match to defeat world number three
Lajovic was facing break point in the third game of the match, but Medvedev sent a volley long and the Serb held for 1-1. He then held triple break point at 2-2 only to see the Russian dig out of that hole to hold.
The normally reliable Lajovic backhand let him down as he committed back-to-back unforced errors to hand Medvedev the break, but the world number broke back immediately and held after nearly giving away his serve from 40-0 up.
A tiebreaker would eventually decide the set and at 1-1, Lajovic retrieved a drop shot and flicked it past Medvedev for a winner to gain a minibreak advantage and he claimed the tiebreaker when the top seed double-faulted on set point.
Medvedev was on the defensive at the beginning of the second set, having to save two break points in the first game before turning the tables on Lajovic, holding a break point only to see the Serb save it with an overhead.
At 4-4, Medvedev committed consecutive double faults from 15-30 down to get broken and received a point penalty that carried into the next game, Lajovic serving for the match already up 15-0, he sealed victory after the top seed missed on a forehand.