The family of nine-year-old Mackenzie Furniss have been trying to raise £300,000 to pay for her to fly to Germany where doctors can provide pioneering immunotherapy, which has helped other sufferers survive.
Mackenzie, of Sauchie, Clackmannanshire, was diagnosed with stage four neuroblastoma when she was five. The cancer attacks the nervous system and is usually fatal. Fewer than 100 children in the UK are diagnosed with the disease each year.
Immunotherapy treatment, which uses the body's immune system to help fight the disease, can boost patients' chances of survival from 5% to 80%.
However, the treatment is not available on the NHS and is only at the trial stage in Germany. But with just under a week to go until the cut-off point for the fundraising drive, the Scottish Government has agreed to cover 90% of Mackenzie's medical bills.
She will initially be treated in Scotland, at Glasgow's Yorkhill Sick Children's Hospital, and will now only have to travel to Germany for follow-up treatment, which will be paid for by money already raised by the campaign.
Keith Brown, Mackenzie's local MSP, wrote to Cabinet Secretary for Health, Alex Neil, when he heard about the youngster's plight.
Mr Brown said: "When I heard about Mackenzie's condition, I wrote to the Cabinet Secretary for Health, expressing my concerns and asking that all potential solutions were fully explored.
"I was delighted to receive confirmation on Friday, that following discussions with Yorkhill and the German medical facility who offer the trial treatment, around 90% of the cost will be met by the NHS and that Mackenzie will be able to be treated here.
"I understand that NHS specialists will discuss full details with the Furniss family this week and while Mackenzie will require to travel to Germany for some follow up therapy, which will have to be funded privately, thanks to the generosity and efforts of so many people in Clackmannanshire, Scotland and around the world the amount required is likely to have been raised."
Mackenzie's battle has gained her some celebrity backers, with pop star Pink donating £10,000 to her appeal fund. Hollywood actor Justin Long, who starred in He's Just Not That Into You with Jennifer Aniston, also donated £640.
The schoolgirl also recorded a video of herself dancing to pop band One Direction's hit Live While We're Young while in hospital waiting for chemotherapy.
Band member Harry Styles tweeted her dad Jason saying: "Hi Mate, my friend Will sent me this video. It's amazing. Hope you're well, get in touch."
Mackenzie was elated when she saw Styles's message and admitted it helped her through a difficult week when she was told the chemotherapy wasn't working.
Her dreams came true when she watched the group in concert in February this year. Her parents painted the boy band's logo and names on her head to make sure she stood out.
Overall, the family have collected £100,000 and have vowed to carry on fundraising to ensure that Mackenzie's trips to Germany are all paid for.