CARTHAGE, N.C. - A lone gunman burst into a North Carolina nursing home Sunday morning and started "shooting everything," barging into the rooms of terrified patients, sparing some from his rampage without explanation while killing seven residents and a nurse caring for them.

Authorities said Robert Stewart also wounded three others, including the Carthage police officer who confronted him in a hallway of Pinelake Health and Rehab and stopped the brutal attack. Officials said the massacre could have been bloodier if the officer had not managed to subdue Stewart.

"He acted in nothing short of a heroic way today, and but for his actions, we certainly could have had a worse tragedy," said Moore County District Attorney Maureen Krueger.

By late Sunday afternoon, Stewart, 45, of Moore County, was charged with eight counts of first-degree murder and a single charge of felony assault of a law enforcement officer. Authorities offered few other details, allowing only that Stewart was not a patient or an employee at the nursing home and isn't believed to be related to any of the victims. They planned to release more information at a news conference this morning.

"I don't know if the emotion entirely has set in," said Police Chief Chris McKenzie, a Carthage native who said nothing in his nearly 20-year law enforcement career compared to Sunday's slaughter. "It's a small community built on faith, and faith will get us through."

While authorities declined to comment on a possible motive, Stewart's ex-wife, Sue Griffin, said he had been reaching out recently to family members, telling them he had cancer and was preparing to "go away." "He did have some violent tendencies from time to time," she said.

Authorities said Stewart began his rampage around 10 a.m. at Pinelake Health and Rehab in the North Carolina Sandhills, about 60 miles southwest of Raleigh, firing shots inside and outside the home.

It ended when 25-year-old officer Justin Garner traded gunfire with Stewart in a hallway, wounding the suspect.

Beverly McNeill said her mother, nursing home resident Ellery Chishole, called moments after the gunman stormed into her room and pointed his "deer gun" at her roommate. "They're up here shooting, they're up here shooting," she frantically said into the phone.

Chishole told her daughter she hid her face in her shirt so she couldn't see the man or what she expected him to do, McNeill said. But for some unknown reason, he didn't shoot, but left the room and began shooting down the hallway.

Sunday's rampage happened just weeks after a man killed 10 people in the worst mass shooting in Alabama's history on March 10.