The sixth-seeded Karlovic, who served 21 aces, broke Melzer at 2-2 in the opening set, shortly after the Austrian was treated for dizziness.
The second set went without service breaks into a tiebreaker after Karlovic saved a set point for Melzer at 5-4.
Karlovic next plays either top-seeded David Ferrer or Tobias Kamke of Germany, who rallied to defeat Simone Bolleli of Italy 3-6, 6-3, 6-4.
The fifth-seeded Lukas Rosol of the Czech Republic beat Lukas Lacko of Slovakia 6-2, 6-4 to set up a second-round match against Viktor Troicki of Serbia.

Latest News from Sports News Desk