Lurie Children's Hospital caught the surprise visit on camera.
Drake and Sofia sang his song “God’s Plan,” took selfies and traded autographs.
Sofia's mother, Natalie Sanchez, told the Daily Herald the song has been a source of inspiration for her daughter, who is in the hospital for seven weeks while she waits for a new heart. Sofia has cardiomyopathy, which makes it hard for the heart to pump blood to the body and can lead to heart failure.
“That actually has been a big influence for her. She would say, ‘God has a plan for me, too,’ just like his song,” Sanchez said. “She loved how he was giving back to the community. She just thinks he's a great guy.”
>> Need something to lift your spirits? Read more uplifting news
According to an Instagram post from Drake, the two also talked about Justin Bieber, owls and basketball. The Chicago Sun-Times reported that a spokesperson for the hospital said the two also bonded over the rapper's two dogs.
At the end of the visit, Sofia was gifted a hat with the logo for “Scorpion,” his latest album.