ROME — A 19-year-old American student has confessed to killing a policeman in central Rome, in a crime that has shaken Italy, the national news agency ANSA reported on Friday.

Mario Cerciello Rega, an officer with the Carabinieri military police, was repeatedly stabbed early on Friday after trying to arrest two people suspected of stealing a bag from a man in a popular tourist district.

Initial media reports suggested the assailants were North Africans, but the police later said they had arrested two American students in an upscale city center hotel and had taken them in for questioning over the incident. Neither man was named.

ANSA reported that one of the two had confessed to the killing. The police did not immediately respond to a request for comment.