Majchrzak, ranked 73rd in the world, had lost his previous four matches before the win over 79th-ranked Medjedović.
The pair had met only once before, with the Serb winning last year's French Open first round, but this time Majchrzak was dominant throughout.
The Pole's serve proved decisive, with 13 aces and 84 percent of first-serve points won, while Medjedović struggled with six double faults.
Majchrzak also finished well ahead on winners and unforced errors, 28 to 15 against 25 to 38 for his opponent.
He will next face either 22nd seed Valentin Vacherot of Monaco or American Aleksandar Kovacevic, who meet on Monday, with Majchrzak's second-round match scheduled for Wednesday.
Also in action on Monday will be Poland's other men's singles player, Hubert Hurkacz, who takes on Bosnia's Damir Džumhur.
(ał)
Source: PAP