The former world No1 headed to the Hard Rock Stadium looking to regain momentum after a third-round defeat by fellow Briton Jack Draper at Indian Wells last week.
Murray had previously reached the final of the Qatar Open in Doha having battled admirably to the third round of the Australian Open, yet was unable to plot a route to progress in Miami as he went down 6-4, 7-5.
The three-time Grand Slam winner had break points in the fourth and sixth games of the opening set. But it was Lajovic, ranked 76th in the world, who struck first by breaking Murray to love in the seventh game before going on to take the opening set in 42 minutes.
The two men continued to trade blows in the second set, and again it was Lajovic who made the opening move when he secured a break in the ninth game to leave him serving for the match.
But with the game tied at 30-30, Lajovic produced his first double fault of the set to allow Murray the opportunity to break back instantly which he grabbed with both hands.
However, a scrappy game followed for an off-colour Murray, with Lajovic prospering to break and have another go at moving into the next round. And the Serb made no mistake as he saw off a forlorn Murray to secure a second-round date with Maxime Cressy.
“I was able to hustle and get to the deuce at 5-5, and I think he felt the pressure,” said Lajovic. “This last game I felt super-tight, too. When I was 40-0 up and I missed some first serves he was able to put pressure on, but luckily he missed a shot that he doesn’t normally miss.
“I played a good match and I was very solid on my serving games. When I was able to play more aggressively in his service games I was able to take my chances.”
Murray admitted he had struggled with several aspects of his game.
“Some days you obviously don’t hit the ball your best, but my movement wasn’t great today,” he said. “I served pretty well, but the rest of the game was a bit of a problem.
“Obviously I was hoping to do much better here. Whether I stay and train here on the clay for a few days before heading to Spain, I’m not sure.”
On a day of exits for British players in Miami – following Emma Raducanu’s earlier defeat – Kyle Edmund also lost.
The former British No1, back in action for the first time since the Australian Open following a series of injury problems, suffered a 7-5, 7-5 defeat to China’s Wu Yibing in one hour and 35 minutes.
Additional reporting by the Press Association.