A Florida husband shot and killed his wife after waking up in the middle of the night and thinking she was an intruder, authorities said.

Officers were called to the home in Stuart, about 40 miles northwest of Palm Beach, around 1:30 a.m. on Wednesday, according to a Martin County Sheriff’s Office incident report obtained by NBC News.

When officers arrived, the man told them that he had shot his wife by accident and his “life is over,” William Snyder of Martin County Sheriff told news outlets.

The report said the wife was found inside the home suffering from a gunshot wound to the head. A handgun with an attached light that was turned on was found next to her.

“He gave us a pretty in-depth statement, in which he said that he awoke in the middle of the night, thought he heard somebody in the house, went to investigate with a handgun, saw a shape in the hallway and fired one round and unfortunately, it turned out to be his wife,” Snyder said.

The woman was six months pregnant, and doctors were able to save the baby, WPBF reported.

Deputies said a 2-year-old child was in the home when the shooting happened.

“This is a nightmare case,” Snyder said. “You know somebody who thinks he’s defending his home, actually shoots his wife.”

“So, though we do have a good statement from him, we don’t take anything to face value and we’ll continue investigating through all backgrounds; there’s a lot of investigative steps that we’ll have to make sure that he’s telling the truth,” said Snyder.

Snyder also warned people who have guns in their home to be very careful.

“When you have a home where you have family members, you have to be even more careful and wait that extra second and do everything you can to make sure you know what you’re dealing with when you’re about to use deadly force,” Snyder said.