Police are trying to establish a motive after an Adelaide man allegedly killed three of his neighbours and left a teenage boy and policeman fighting for life after a shooting spree.

A woman at the house in the suburb of Hectorville survived the bloodshed but her parents and husband were killed and her 14-year-old son was shot and seriously injured. An 11 year-old boy staying at the house survived injury after hiding in a bedroom.

The woman - who has not been named - called police at about 2.30am after hearing gunshots. Although police arrived within two minutes, detectives believe the three victims were dead when they arrived.

The 39-year-old alleged gunman fired at the police with a shotgun and hit one officer in the jaw. The officer is in an induced coma after surgery.

After the shootout with police the man returned to the property next door, which he shares with his parents, and a standoff ensued until he gave himself up at about 10.30am. During the siege his mother was released. His father was not at home at the time.

The South Australian Police deputy commissioner, Gary Burns, praised the "excellent response time" of the officers who first attended the scene, saying it might have saved the lives of two other people who lived in the house.

''It is four members of a family of six who were shot, three generations,'' he said.

''We are not sure what has instigated this incident, we have not had any dealings with anyone from those properties for over 12 months.

''It is a huge tragedy: three people dead, one seriously injured, another police officer seriously injured ... and we are not sure why.''

A neighbour said she was woken by the shooting. "Within a minute or two there were cops everywhere," she said. "Then there was helicopters overhead. It was like a battlefield."

The woman, who asked not to be named, added: "The family who lived in the house and who seemed to be killed always seemed nice to me, so I don't know what the row could have been about."

The alleged gunman was charged with the murder of a 64-year-old man, a woman and a 41-year-old man, as well as two counts of attempted murder. He was remanded in custody and is due in court on Monday.

Deputy Commissioner Burns said a policewoman who was one of the first on the scene had been a nurse and was able to administer first aid.

He said: ''I extend my thanks and praise to the officers who acted with courage in this very dangerous situation.''