The British No 2 began the match with two double faults and lost the first eight points but thereafter was the better player and came through 4-6, 6-3, 6-4, 6-4.
Bedene has been struggling for confidence amid the stress of his battle to compete for Britain in the Davis Cup. The Slovenia-born player should learn in the next week or two whether there is any chance of another appeal and he revealed the uncertainty has taken such a toll on him that it has translated into physical pain.
However, he was happy with his form and that showed against Austrian qualifier Melzer, whose brother Jurgen beat Novak Djokovic here in 2010 on his way to the semi-finals.
Bedene, who is being coached on a temporary basis by GB Davis Cup captain Leon Smith, will play either 31st seed Federico Delbonis or Spain’s Pablo Carreno Busta in the second round.
In the women’s singles, British No 1 Johanna Konta was dumped out in the first round by German Julia Goerges.
Konta’s remarkable rise up the rankings came on the back of upsets at the US Open, where she reached the fourth round, and Australian Open, where she brilliantly made the semi-finals.
She went into the year’s second grand slam seeded 20th and with hopes of another lengthy run in the unpredictable women’s draw. But Konta ran into a player in the mood for a scalp and world No 57 Goerges was exceptional in a 6-2, 6-3 victory.
The German, who was once ranked in the top 15, crunched 30 winners in the match compared to just four from Konta.
Laura Robson’s struggles continued as she suffered a 6-2, 6-2 loss to Andrea Petkovic.
It was an extremely tough tie for Robson, the lowest-ranked player in the women’s draw, against a player seeded 28 who reached the semi-finals at Roland Garros two years ago. Since 2014 and the start of the wrist problems that have derailed her career, Robson has not beaten a top-100 opponent and is languishing at 329 in the rankings.
Her ability to hit winners remains but too often the 22-year-old relies solely on her power and a tally of 37 unforced errors in 16 games against Petkovic told its own story. Robson will now hope for some morale-boosting wins on grass, which is a more natural surface for her.