The 29-year-old Safin, a two-time Grand Slam title winner, put on a solid performance on center court but couldn't overcome the U.S. Open champion.
Also advancing was Rafael Nadal, who saved all five of the match points he faced at the end of the second set before edging Nicolas Almagro of Spain 3-6, 7-6 (2), 7-5 to reach the third round, while top-ranked Roger Federer lost 3-6, 7-6 (4), 6-4 to Julien Benneteau of France in the second round. The 15-time Grand Slam champion has never been further than the quarterfinals at the Paris Masters.
"He played incredible at the end. Julien went out and got the victory," said Federer, who refused to give excuses. "I definitely had chances. I missed them. I feel fine physically, and mentally I was fresh to do really well here."
Benneteau aced his first match point and fell to the floor in tears. He next plays countryman Gael Monfils.
Safin, a three-time winner in Paris, captured the 2000 U.S. Open and 2005 Australian Open among his 15 singles titles. He has said he will quit playing after this season.
The charismatic Russian hasn't won a tournament since that victory in Australia. His best result this year was reaching the semifinals in St. Petersburg, Russia, last month.
"Today I will put all my memories, all my wins and losses in a small box," Safin said during a small ceremony where he received a special trophy. "Today a door is closed, hopefully another one will open."
The former No. 1 player was joined on the court by several current and former players, including Marc Rosset, Younes El Aynaoui and Albert Costa.
"It's really a special feeling to see Younes, Marc and Alberto here," Safin said. "We had some fun together. For me it means a lot that they came to say goodbye."
For his last match, Safin gave the Parisian crowd a perfect picture of his style, with terrific winners from the baseline, a fine touch at the net, strong first serves but also horrendous unforced errors and racket throwings.
In the first set, he missed a chance to break del Potro when the fifth-seeded Argentine served a winner to even it at 3-3. Safin then lost his serve after sending a forehand wide and del Potro ended the set with a service winner.
Safin saved a break point at 5-5 in the second set and had three set points when del Potro sent a forehand in the net. Del Potro survived the first one with a service winner but was left stranded by Safin's forehand winner on the next point.
In the third set, del Potro broke for a 2-1 lead and finished Safin off on his second match point with an ace.
Del Potro congratulated Safin at the net while the audience gave Safin a standing ovation.
Nadal started slowly and trailed 5-2 before losing the first set when he sent a forehand into the net. The former top-ranked Spaniard then lost his serve twice in the second set but still managed to force a tiebreak.
Nadal, who has never won the Paris Masters, called for a trainer during a changeover and was treated for a blister on his right foot. Almagro then looked set for his first victory in five matches against Nadal after leading 3-1 and then 5-3, but he injured his left thigh and was barely able to finish the match.
After trading breaks in the first set, Djokovic broke again in the eighth game and then served out the match.
Djokovic, who has never gone beyond the third round at this tournament, led 2-0 in the second set but then lost five consecutive games. He saved a set point in the eighth game before leveling at 5-5 with a combination of drop shots and powerful groundstrokes.
Djokovic broke to lead 6-5 when Monaco sent a backhand long, and he then closed it out on his first match point.
Soderling, who will take on former champion Nikolay Davydenko in the third round, needs to at least reach the final to have a chance of qualifying for the season-ending event in London later this month.
Soderling won 72 percent of points on serve and hit 12 aces to beat Karlovic, who failed to convert any of his eight break opportunities.
Fourth-seeded Andy Murray had 21 aces in beating James Blake of the United States 6-3, 6-7 (5), 7-6 (4) in a match that finished long after midnight. Neither player could break the other in the last two sets.
Information from The Associated Press was used in this report.