Mayor Mario Savarese said the gunman and the victims – reported to be two brothers aged five and 10, and a 74-year-old man – were from the same housing development in Ardea, where the tragedy unfolded.

The 34-year-old shooter holed up in a nearby apartment for three hours as negotiators tried to persuade him to come out.

Armed officers finally forced their way in and found him dead, according to Italian news agency ANSA.

The gunman was identified as Andrea Pignani, an unemployed computer engineer who had been living with his mother and had reportedly not left the house in around a year.

Accounts by locals suggest the man suffered from mental health issues and had threatened neighbours in the past by waving a gun in the air, according to Italian news agency ANSA.

The weapon had been held legally by the man’s father, a security guard who died last November.

However, the gun was never reported to authorities after his death and police sources told the media that they had not received any complaints.

At around 11.00 am on Sunday, Pignani left his house, armed with the pistol, and walked through the residential area of Colle Romito.

On his way, he encountered Daniel and David Fusinato, two brothers aged five and 10, who were playing in a park in front of their house.

Pignani shot them at point-blank range, for no apparent reason.

Alessio D’Amato, health commissioner for the local region of Lazio, confirmed the deaths of the children after they were taken to hospital.

“I am deeply shocked by what happened and express all my regret and my heartfelt condolences to the family and the entire Ardea community, which today is in terrible mourning for this tragedy,” he said.

Pignani also shot Salvatore Ranieri, killing the74-year-old who was passing by on a bicycle.

According to witnesses, Ranieri had tried to intervene when he saw that Pignani had a gun.

Ranieri, who reportedly knew neither his killer nor the two brothers, had been staying with his wife at their holiday home in Ardea, located around 40 kilometres south of Rome.

Ranieri’s wife reportedly discovered her husband’s body at the scene of the shooting after becoming worried when he did not return from his ride.

Police are attempting to find a motive for the seemingly random attack, which has been condemned by politicians and has opened up a debate in Italy about possession of firearms.