Justine Davis and her three-year-old son, Cameron, were in Cayo Largo during the holidays when they were hit by a truck.
Cameron was killed. Under Cuban law, Davis wasn't allowed to leave the country until the investigation was complete, though Cameron's body was sent home.
As the weeks dragged on, it looked as if Davis wouldn't be free in time to attend the funeral, which is this Saturday.
Loved ones — frustrated by the lack of progress through official channels — organized an online campaign, putting pressure on Ottawa and Cuba.
"When we got to week six and had no answer we felt really helpless and lost; it's uncharted territory," longtime friend Amber Hussy told CBC News. "So we tried a different approach."
An online petition aimed at Yves Gagnon, Canada's ambassador to Cuba, had accumulated more than 36,000 signatures by Thursday afternoon. The "Bring Justine Davis Home" page on Facebook has more than 6,500 "likes."
According to a ministry spokesman, Minister of State Lynne Yelich "personally appealed" to Cuban officials for help.
Yelich said today via Twitter that Davis has been released.
Davis remains in hospital, however. She has undergone five surgeries for injuries sustained in the crash that killed Cameron. Hussy hopes to bring her home soon, though no firm plans have yet been set.
The victory is "bittersweet" she said.
"It's happy to have her coming home. We wish it was hand-in-hand with Cameron, obviously," she said. "But we also know she's got a huge, huge grieving process ahead of her and a physical healing process with all the injuries she's sustained. But it's best to get that process started at home with friends and family."