This celebration of life and love was released as the first single from Demi Lovato's fourth studio album. "The title is just about falling in love and taking that risk," Lovato told MTV News. "But, she's terrified and, by 'she,' I mean me. But, I think everyone comes to a point where they feel very vulnerable in falling in love and that's what I'm talking about." The song premiered via international streaming on February 24, 2013 and was exclusively released on iTunes a few hours later in the United States.

The song was produced by the Suspex (Mitch Allan and Jason Evigan) and was co-written by the production duo with Lovato, Sean Douglas and Nikki Williams.

Demi shot the cover for the single hours after breaking her leg. The accident happened as a result of Demi slipping on the floor after her roommate cleaned it with Pledge. "Thank God I went, because it's my favorite photo shoot I've ever done," the singer told Extra's Renee Bargh, "and they were able to shoot it so you don't see my foot."

Demi explained the song's meaning to Ryan Seacrest: "'[Heart Attack]' is a song [about] I think everybody's been in a situation where they've been hurt several times," she said "[And] other situations where I felt abandoned in my life and when you open up your heart to somebody it's a risk. And this song is about taking that risk."

It was singer-songwriter Nikki Williams (Lauren Alaina's "Like My Mother Does") who originally penned the song one Halloween night during a studio session for her debut album. Williams told Billboard magazine that she was inspired by "some f------ boy s--t" as she poured the emotion into the lyrics."That song just... happened," she added. "It was just a good flow with the other writers. But... I knew it wasn't for me. It just didn't fit in with the rest of my album."

It was co-producer Jason Evigan who originally came up with the song title after Nikki Williams came into the studio talking about one of her crushes. "I pulled the title 'Heart Attack' from when [Nikki] actually likes someone, she has a heart attack," Evigan recalled to MTV News. When she decided it wasn't for her, Allan, Evigan and Douglas "thought 'Wow that's surprising.' We thought it was going to be a hit."

"A lot of people wanted the song," continued Evigan. "And then Demi came in to do another song called 'Two Pieces' and then we played her 'Heart Attack' and she freaked out about it. So she came in to record it and then she actually had a couple of lyric changes that were really good. She added that super high note at the end and she added some really cool things to it and she brought that song to life."

Evigan revealed to MTV News how once Lovato got her hands on the song, she made it all her own. "The first version had a dubstep break in it," he said. "We took that out for her ... Demi has magic to it where she has so much sass in her voice but yet so much power and all those really high notes at the end, she added that on the spot. [Some of those notes are] all freestyle and like that, I feel like, took the song up notches."

The music video was directed by Chris Applebaum, who has also helmed clips for Rihanna, Britney Spears, and Mariah Carey. The visual mixes images of Lovato wearing dark makeup covered in black ink with the singer in white clothes with less makeup. "The song is about this kind of duality that Demi faces," Applebaum explained to MTV News. "She's singing about really wanting to fall in love. But then also really wanting to make sure she holds herself back a little bit, so she doesn't get hurt. She constantly is singing about this duality throughout the song. It's like a push and pull where we tried to metaphorically represent those two sides by having two metaphorically different sides of Demi."

He added, "There's the angelic white. First you see Demi pictured in this more angelic white performance where these darker black elements start creeping into the frame almost ready to take over her. And then you also see her, the polar opposite, a black set-up where there's some white or good, I don't want to say good or evil, or good or bad, there's just sort of these opposites. You see her in this black environment where these forces of white, the opposite, are still present and creeping in."

When shooting the video, Lovato did something that Applebaum's only seen Celine Dion do before her - sing live. "I do also want to note that in 20 years of directing music videos, I have seen every single artist lip-sync to their video with the exception of two people. One was Celine Dion, who said, 'If you don't do that, you sing so that people can see your throat move and people can feel the emotion.' And two, it was Demi Lovato," Applebaum revealed to MTV News. "Demi is the real deal. People felt it when they were around her."