The incident happened in an up-market neighbourhood near Vatican City. (Representational)

Two US teenagers appeared at a court hearing in Rome on Saturday after being arrested over the murder of an Italian police officer whose death has sparked a national outcry.

Officer Mario Rega Cerciello died after being stabbed eight times as he and a colleague tried to arrest two men following a complaint for theft. Cerciello, 35, had only recently returned from his honeymoon.

His killing took on a political aspect when the country's far-right Interior Minister Matteo Salvini, responding to initial reports that the suspects were North African, denounced the killers as "ba****ds".

Police said they arrested the two American teens on Friday as they were preparing to check out of their Rome hotel and fly home.

Prosecutors have charged them over the killing, which occurred in the small hours of Friday morning in Rome's city centre.

Media reports citing the police have named the two suspects as Christian Gabriel Natale Hjorth and Elder Finnegan Lee, both aged 19.

One of them has confessed to the killing but said that he did not realise that Cerciello was a police officer because both the officers involved were in plain clothes, according to Italian media reports, citing the police.

The incident happened in an up-market neighbourhood near Vatican City.

A statement from Italian police said that the two Americans had confessed to stealing a bag from an Italian. They were demanding 100 euros ($111) and a gramme of cocaine for its return.

The victim of the theft tipped off the police, but when the two officers went to arrest the pair, one of them pulled a knife.

Italian media reports, citing investigators, said that the two US teenagers told police that the man they had stolen from had sold them aspirin powder instead of cocaine.

The suspect who confessed to stabbing Cerciello said he had taken the officers for friends of the alleged dealer and had panicked.

Police said surveillance cameras helped them track the pair to their four-star hotel where they arrested them. Their bags were packed and they had been planning to fly home that same evening.

Floral tributes

Officers found a large knife hidden in the false ceiling of their hotel room and seized clothing that the pair were thought to have been wearing on the night of the murder.

Prosecutors in Rome are holding them on suspicion of aggravated homicide and attempted extortion.

The American who confessed to killing remained silent during a court hearing in front of a judge on Saturday afternoon, his lawyer told local media.

The killing has made front-page headlines in Italy. Many people have left floral tributes left at the spot where Cerciello died.

On Friday, Salvini called for "hard labour for life ... for these ba****ds" amid early reports that the suspects were North African. "The suspects were filmed by surveillance cameras, they will not evade us," he said.

Cerciello is to be buried on Monday in his home town at the foot of Mount Vesuvius, southern Italy.

A spokesman for the US State Department said: "We are aware of these reports. When a US citizen is detained overseas, the Department works to provide all appropriate consular assistance."