(CNN) "Biggest Loser" host and fitness trainer Bob Harper said he is thankful to be alive after suffering a mid-February heart attack at age 51 while working out in a New York City gym.

"I had what they call a widowmaker. ... The fact there were doctors in the gym when I had the attack saved my life," Harper said in an early morning appearance on the "Today" show Tuesday.

"I was in full cardiac arrest," Harper continued. "I was dead, on that ground dead."

Harper has appeared on 17 seasons of the NBC show "The Biggest Loser" and is the author of three bestselling books on fitness. Harper said he was working out with friends when he collapsed, spending the next two days in a hospital in a coma.

"I don't remember that day at all," Harper said. "I was told that I went to the gym Sunday morning ... and at the end of the workout, I went down to the ground."

Harper said he was doing CrossFit training, which involves a lot of up and down movement. So when he collapsed, it took a "minute or so" for those around him to realize that something was wrong. Once they did, said Harper, a coach went into full damage control and found two doctors at the gym to treat him.

"I was so lucky," Harper said. "They started performing CPR on me. They pulled out the AEDs (defibrillators) and used those on me twice before the paramedics got there and jolted me one more time."

Harper said he woke two days later in the hospital, surrounded by family and friends.

"I was so confused," said Harper. "I was like Dory from 'Finding Nemo' with short-term memory, reliving the heart attack over and over. 'Why am I here? What happened to me?' Then 10 minutes later, I was asking that all over again."

"I was super emotional," said Harper, with tears welling in his eyes.

Every year, about 735,000 Americans have a heart attack, according to the US Centers for Disease Control and Prevention . Family history plays a major role in heart health, as inherited genes can elevate the potential for high blood pressure and high cholesterol.

Despite being in terrific physical condition, Harper says he was not able to avoid his family history of heart disease. His mother died of a heart attack.

"It was hugely shocking. I learned a lot about myself," he said. "Genetics does play a part in this. I'm a guy who lives a very healthy lifestyle, work out all the time, but there were things going on inside my body that I needed to be more aware of. So I strongly encourage anyone to go to the doctor, get your cholesterol checked, see what's going on in the inside so it doesn't happen to you, what happened to me.

Regular exercise can reduce the threat of heart disease, but there is a small risk that exercise itself can increase the chances of a heart attack in the short-term. Most of that risk, however, is in the hours following a workout and, according to the American College of Sports Medicine , is much lower in a person who is already fit.

In Harper's case, he said there were warning signs that he ignored.

"Before the heart attack, I was having dizzy spells," he said. "I should have taken that more seriously. Man, it's been a huge wake-up call for me."

Until this interview, the fitness guru has been keeping his fans up to date on his recovery via social media.

"Talk about starting back at SQUARE ONE. I plan on being the BEST STUDENT. #heartattacksurvivor," said the caption on an Instagram video posted in mid-March.

Well while all of my @crossfit family is getting ready for 17.3, I'm walking on a treadmill doing a stress test. Talk about starting back at SQUARE ONE. I plan on being the BEST STUDENT. #heartattacksurvivor A post shared by Bob Harper (@trainerbob) on Mar 9, 2017 at 7:16am PST

Harper said he has been following a Mediterranean diet since his hospitalization, which involves eating mostly vegetables, fruits, nuts, beans and peas, unrefined grains, olive oil and fish. Meat, dairy and saturated fats are eaten sparingly. Numerous studies have linked the Mediterranean diet to a lower risk of cardiovascular problems.

"I have been the best patient," he said. "Cardiac rehab has been excellent for me. I do exactly what the doctors tell me.

"I'm going through some depression," Harper admitted, tearing up again. "You really face your mortality. And I'm really understanding what's important in life. And let me tell you, I'm not sweating the small things anymore. I'm going to appreciate every single day that I'm here."

Join the conversation See the latest news and share your comments with CNN Health on Facebook and Twitter.

Harper also said that he wants people to know that they should only work out at gyms that have the proper equipment in place to immediately respond to a cardiac event.

"I will never, ever, walk into a gym again that doesn't have people who know CPR and an AED somewhere in that gym," he said. "And I will make sure that every place has something like that."