Jennifer Garner
Actress Jennifer Garner arrives at the Vanity Fair Oscar Party in Beverly Hills, California February 28, 2016. Reuters/Danny Moloshok

Jennifer Garner has fulfilled a childhood dream.

Days before her 50th birthday on Sunday, the actress received a heartwarming surprise from her childhood idol, Donny Osmond, while she was out enjoying a meal.

The surprise began with Garner watching a personalized e-card that Osmond, 64, had recorded, in which he wished her a happy birthday and sang a song.

However, the singer himself was sneaking up behind her with a birthday cake in hand.

As the video came to an end, Osmond began to sing the same birthday tune, causing Garner's hands to fly up and cover her face. The actress then immediately stood up and hugged the former teen idol.

In the adorable clip, which Garner later shared on Instagram, the actress can be seen removing her sweater at one point because she's "so hot."

She then revealed the sweet message on the cake that Osmond brought her, which reads, "13 Going on 50! Love Donny," a nod to her hit 2004 movie "13 Going on 30."

The pair also sang a rendition of Donny & Marie's 1975 hit, "Make the World Go Away," before Garner covered her face with a napkin, clearly overwhelmed by the surprise.

"My first (pre)birthday surprise was a doozy. The one and only, legend in his own time, object of my childhood adoration and devotion, @donnyosmond, showed up to knock my purple socks off," Garner wrote alongside the video, which has received nearly 7 million views since she uploaded it.

"He took an hour and a half of his day to sit with me, sing my favorites, and to give me a master class on how to be a class act. Thank you, Donny," she continued, before adding: "Hi, @marieosmond. I hope to meet you someday, Debbie."

Garner's followers and pals gushed over the adorable video and wished the actress a happy birthday in the comments section.

"Happy (pre-)birthday, beautiful Jen! Wishing you many more decades of great health and joy," Dr. Doris Day commented.

"This is the freakin' best!" Robyn Schall wrote.

"I don’t believe it! He is everything!!!!!" Tracey Cunningham commented.

"This is amazing. Could I love you more? Nope. Happy pre-birthday," another follower wrote.

"How incredible! Have a fantastic birthday season!" Toure Roberts commented.

"Oh my god, I love this!!! Happy birthday!!! @donnyosmond gave me my first 10 on 'DWTS'!! I love him and you! What a fun surprise!" Amy Purdy wrote.

Osmond shared the same video on his Instagram account. According to the "Puppy Love" singer, surprising fans is "one of my favorite things to do."

He added that he was "overjoyed" when he got the "opportunity to surprise the lovely" birthday celebrant for her 50th birthday. The singer also invited Garner to come and see him perform when she visits Las Vegas.

"Next time you’re in Vegas, come see me at @harrahsvegas so you can be my special guest on stage," Osmond wrote.

Jennifer Garner

Photo: Frazer Harrison/Getty Images