Novak Djokovic marked his return to the singles court with a hard-fought win in his Paris Masters opener against Hungary's Marton Fucsovics.
"It was a great fight and a great opening match for me," said the Serb.
"I did not expect anything but I knew it was not going to be an easy match."
Djokovic, aiming to finish 2021 as the year-end men's number one for a record seventh time, will play Adrian Mannarino or Gael Monfils in the third round.
After winning alongside compatriot Filip Krajinovic in the Paris doubles on Monday, Djokovic returned to the more familiar surroundings of the singles court after being given a first-round bye.
The 20-time Grand Slam champion took an extended break after the emotional defeat by Medvedev in New York, where Djokovic was left in tears when his dream of becoming the first man in more than 50 years to win all four majors in the same season was ended.
On his return against 40th-ranked Fucsovics, Djokovic started sharply and looked relatively at ease despite not having played competitively for almost two months.
But Fucsovics fought back in the second set, varying his service game and posing more problems for Djokovic as a result.
Djokovic broke for 4-2 in the third set as Fucsovics' serve wavered and the top seed's delight at coming through a stern test was evident as he celebrated victory.
"I couldn't break his serve, he was playing with a lot of precision and we pushed each other to the limit," said Djokovic.
French pair Mannarino, 33, and Monfils, 35, meet in the second round on Wednesday.
British number one Cameron Norrie is also back in action on Wednesday as he continues his efforts to qualify for the season-ending ATP Finals in Turin later this month.
Norrie, seeded 10th, is involved in a tight race for one of the remaining places in the eight-man tournament and must beat American Reilly Opelka when they meet - at about 14:00 GMT - to keep his hopes alive.