Sharaeva (24), making her debut in Beijing, said "I can't find the right words to express myself," adding, "This is unbelievable."
She praised the top seed, saying, "She is an amazing player, and for me, this is like a dream come true."
She continued, "I will be very happy to stay a few more days in Beijing. I think I should never stop believing."
Rybakina started the match strongly and claimed the first set, but seven double faults handed her opponent the momentum in the second set.
The crowd tried to encourage Rybakina to get back into the game in the decisive third set, but Sharaeva held her serve to win the set and the match on her second match point after two hours and 11 minutes.
Sharaeva will face Britain's Sonay Kartal in the third round.
In other prominent second-round matches, American third seed Coco Gauff struggled to defeat Colombian María Camila Osorio 7-6 (7-4), 4-6, 6-2, while Greece's Maria Sakkari (25) had no trouble overcoming Australia's Storm Hunter 6-2, 6-2, and Poland's eighth-seeded Iga Świątek beat China's Xinyu Gao 6-2, 6-3.
Croatia's Donna Vekić (30) needed three sets to defeat China's Lin Zhu 6-1, 4-6, 6-2, as did Ukraine's <NOTE: Svitolina is Ukrainian, text says compatriot mistakenly or refers to tour> sixth-seeded Elina Svitolina, who won against Czech Katerina Siniakova 1-6, 6-4, 6-2.