It was the five-time Grand Slam winner's first appearance since she was beaten by Latvian 16th seed in New York in early September and gets her stop-start return from a 15-month doping ban back on track.
Sharapova, ranked No 104 in the world, is a wildcard in Beijing and she produced a battling performance in Saturday's lively 7-6 (7-3), 5-7, 7-6 (9-7) triumph that lasted over three hours.
Sevastova broke the Russian former world No 1 number one in the seventh game to seize the early initiative but was immediately broken back and eventually lost the opening set after a gruelling tie-break.
The 30-year-old Sharapova looked to be easing into the second round, but she suffered a few wobbles on her serve and saw her opponent strike back to level the match at one-set all.
But the fightback did not last, as Sharapova stayed strong to battle through.
British No 2 Heather Watson earlier lost in qualifying to America's Nicole Gibbs 6-7 (3-7) 6-4 6-4.
Second seed Simona Halep edged past the American Alison Riske in three sets 6-3 3-6 6-2.