CARTHAGE, N.C. - Authorities worked Monday to unravel the mystery of why a 45-year-old painter tore through a North Carolina nursing home on a terrifying shooting rampage that left eight dead, releasing few details but saying it wasn't a "random act of violence."

One possible clue: the gunman's estranged wife works at Pinelake Health and Rehab and was there when authorities say Robert Stewart stormed in and killed seven residents -- most in their late 80s -- and a nurse who cared for them.

"We're certainly looking into the fact that it may be domestic-related," said Carthage Police Chief Chris McKenzie.

Moore County prosecutor Maureen Krueger said detectives were still gathering information on what could have set off Stewart.

"The information on motive is incomplete at this time," she said, adding: "This was not a random act of violence. There is only one suspect and he is in custody."

McKenzie said Monday he believed the couple were recently separated, but acknowledged he didn't yet know many more details about her. A neighbour said Stewart's estranged wife is a certified nurse assistant at the nursing home named Wanda Luck, and public records indicate she shared an address with Stewart in Carthage.

"His (estranged) wife was there at the time the shooting was going on," McKenzie said.

Several telephone numbers for Luck or her family were disconnected. A knock at the door was unanswered at Luck's address.

"This is a horrible tragedy," said Mark Barnett, the neighbour. "This is something that's just unthinkable. I can't even imagine what she's going through."

Another ex-wife of Stewart's, Sue Griffin, told reporters Sunday she had not had contact with him since they divorced in 2001, but said he had been recently reaching out to family members, telling them he had cancer and was preparing for a long trip and to "go away."

"He did have some violent tendencies from time to time," Griffin said. "I wouldn't put it past him. I hate to say it, but it is true."

Authorities said the attack began around 10 a.m. Sunday, when Stewart arrived at the nursing home and care centre for patients with Alzheimer's disease and started firing.

McKenzie said he was armed with more than one weapon, and witnesses said he was shooting a "deer gun." Police recovered a camouflage-coloured rifle or shotgun from the home's parking lot, where at least two cars had their windows shattered, apparently by gunfire.

The shooting rampage was ended by Officer Justin Garner, 25, who entered the nursing home alone as he responded to a 911 call. McKenzie said Garner, a training officer with more than four years on the Carthage force and a past winner of the department's officer of the year award, knew he was headed into a perilous situation, but didn't wait for back-up or a SWAT team to arrive.

"If that's not heroism, I don't know what is," McKenzie said

"He had to go to all the way through the facility to encounter this individual," McKenzie said. "It would be hard for me to believe he didn't (hear gunfire)."

Stewart wounded Garner three times in the leg as they traded gunfire in a hallway of the 110-bed facility, McKenzie said. The single shot Garner fired from his .40-calibre service pistol hit Stewart in the chest.

"Whether he realizes it now, he will hopefully realize someday how many lives he has saved," McKenzie said, adding: "A lot more lives would have been lost, I honestly feel, had he not done what he did. For certain."

McKenzie said Stewart made his initial court appearance during an arraignment hearing Monday morning. He is facing eight counts of first-degree murder and a charge of felony assault of a law enforcement officer.

The lawyer appointed Monday to represent Stewart, John Megerian from Asheboro, declined comment, saying he hadn't yet talked with his client. McKenzie said the district attorney planned to present the case to a grand jury next month.

McKenzie was unaware of any criminal activity in Stewart's past, and records in Moore County show the only charges on his record stem from a drunken-driving case in 1988. He was involved in a few minor civil complaints, including a 2002 order that he surrender $1,103 after a woman complained his painting business failed at repainting some wrought iron furniture.

Detectives were working at the state medical examiner's office in Chapel Hill on Monday to recover evidence, and search warrants police executed in the hours after the shooting were sealed. Court records said Stewart was transferred from the custody of the Moore County Sheriff to the state Department of Correction, because he has a gunshot wound.

Sunday's rampage in North Carolina's Sandhills region, about 100 kilometres southwest of Raleigh, happened just weeks after a man killed 10 people, including his mother and several other relatives, in the worst mass shooting in Alabama's history on March 10. On March 11, a teen killed 12 people at his former high school in Germany.