She underwent surgery on Monday morning, and after nine hours in the operating room, she was back in her bed at Chicago's Ann & Robert H. Lurie Children's Hospital recovering, according to the hospital.

Sofia was diagnosed with cardiomyopathy, a condition that often leads to heart failure, and had previously received open heart surgery. She waited eight weeks for a new heart.

One of the cardiologists on Sofia's team, Dr. Stuart Berger, said she was in good spirits heading into the procedure.

"She was very happy yet nervous, but nervousness is common," Berger said. "She's a delightful young lady."

Drake made the surprise visit to Sofia's hospital room after she posted a video of her dancing in a hospital hallway — while tethered to an IV line — to the rapper's popular "In My Feelings" track. The video had gotten back to Drake, and social media users encouraged him to visit her.

Berger attributes Sofia's positivity to the support of her loved ones — but taking selfies with Drake probably didn't hurt, he said. He's optimistic that she will make a full recovery.

"She will have a heart that works normally and she will be able to run, play and go to school," he told CBS Chicago. "She will need some follow-up care and testing, but she'll be able to do many of things she wouldn't have otherwise been able to do."

Drake surprised 11-year-old Sofia Sanchez at a children's hospital in Chicago. The girl is awaiting a heart transplant and wished on her birthday that she would meet the rapper.