A California couple who wanted a second medical opinion for their 5-month-old son said their ordeal turned into every parent’s worst nightmare. Authorities temporarily took their baby away from them, but the parents are now relieved to be able to hold their son again for as long as they want.

The story began a few weeks ago when Anna and Alex Nikolayev brought their son Sammy, who has a heart murmur, to Sutter Memorial Hospital in Sacramento. The family left the hospital without an official discharge to get another opinion on the boy’s heart condition, according to a report on TODAY Wednesday.

“I want to go to a different hospital and she told me again, ‘If you want to go, then you can go, but your son is going to be here,’” Anna Nikolayev told TODAY. “I took my son. Put him in the stroller. I just walked out of the hospital.”

The couple got a second opinion on Sammy’s condition at nearby Kaiser Hospital, and Sammy was cleared to go home with his parents. But the next day, the couple said, police came to the couple’s house and took Sammy away, and the removal was captured on a home video camera.

“I did not know where my son is,” Anna Nikolayev told TODAY. “I did not know what to do. I did not even know where to start. What to look for. Where is he?”

In court earlier this week, a judge ruled that Sammy should be taken to Lucile Packard Children’s Hospital at Stanford to be evaluated, and his parents regained control of his medical treatment. The judge also said the couple must follow all medical advice and not remove Sammy from the hospital without a proper discharge.

“We've been asking is that we get the treatment in a different hospital, that we’re going to have a second opinion,” Anna Nikolayev told TODAY. “That’s all we've been asking for and we got it.”

The legal case is not over, with the couple due in court on May 28. Child Protective Services officials will visit the family once Sammy is home from the hospital.

Their lawyer, Joseph Weinberger, told TODAY: “A doctor, any doctor, any hospital, anyone, doesn't have the right to make decisions about a child's health care.”

Sacramento County Child Protective Services told NBC News in a statement that the law is clear: “If there is imminent risk of serious physical harm to the child and there is insufficient time to obtain a court order to remove the child from the care of the parents ... the social worker or law enforcement officer can remove the child.”

Sutter Memorial Hospital also released a statement that said: “Our nurses and physicians are bound by duty to call authorities if they believe a pediatric patient's health is in danger. We fully support the judge's decision and are confident the family will receive an excellent second opinion from Lucile Packard Children's Hospital at Stanford.”

As Sammy awaits his transfer, his parents are enjoying their time with him.

“He closed his eyes for a second, then he opens his eyes right away and he looks to the side and he looks at me and, ‘Okay, she's there,’” his mother said on TODAY.