A 60-year-old man has shot dead 13 relatives and neighbours, including a two-year-old child, in a tiny Serbian village, in the country's worst killing spree in two decades.

The man shot most of his victims in the head as they were sleeping before he shot and wounded himself, police said on Tuesday.

The motive for the pre-dawn attack, which shocked the village outside the capital Belgrade, was not immediately clear.

"Twelve people were killed on the spot while the thirteenth died in a hospital emergency room," Milorad Veljovic, head of Serbian police, told journalists.

"Doctors are trying to save the lives of three injured, including the perpetrator of this monstrous murder," he said.

Two-year-old child

It was the killing spree with the most victims in Serbia in two decades, a police source told the AFP news agency.

The national RTS television identified the attacker as sexagenarian Ljubisa Bogdanovic, who it said killed six men, six women and a baby. Police said the 13th victim was a two-year-old child.

The victims were killed around 0300 GMT in five different houses in the village of Velika Ivanca, some 50km south of Belgrade, inhabited mostly by the gunman's relatives, Veljovic said.

"There are a total of five houses, belonging to his family and his neighbours. We still don't know the motive," he said.

All the victims were sleeping when they were attacked and were practically all shot in the head, he added.

The killer is believed to have first killed his 42-year-old son, then his mother, and wounded his wife before continuing his killing spree.

Police later found him in the yard of one of the houses where he tried to commit suicide. The gunman was hospitalised with head injuries and doctors were fighting to save his life, Veljovic said.

'Best neighbour'

Residents of the village described the suspect as a nice, quiet man.

"He knocked on the doors and as they were opened he just fired a shot," said resident Radovan Radosavljevic. "He was a good neighbour and anyone would open their doors to him. I don't know what happened."

Police have sealed off the access to the five houses, located on a hill in a remote area of the village of some 1,700 inhabitants.

"I talked to him yesterday. I asked him how he was, and he said fine. He asked me about my health," Stanica Kostadinovic, a visibly shocked neighbour in her 60s, told AFP.

"He was the best neighbour. Nothing indicated that such a thing could happen. Only he knows the motive for the killing."

"He was a good host, he and his son, nice, hard-working, always ready to help," the woman said, adding that as far as she knew the killer was not consuming alcohol.

According to police, the man had a firearms licence.