Sunday was supposed to be a day of celebration in Rome, with a new government, led by center-left politician, Enrico Letta, sworn in on the Quirinal Hill after 18 months of a crippling political stalemate. There was optimism for the first time in months as the new team of 21 ministers from across the political spectrum—including a record seven women—prepared to take their oaths. But before that could happen, shots rang out in front of Italy’s Palazzo Chigi, the prime minister’s offices in the heart of historic Rome, just a kilometer away.

Two carabinieri fell to the cobblestone piazza in a pool of blood. One was shot in the leg. The other was shot on the left side of his neck, the bullet narrowly missing his spinal cord before lodging in his right shoulder. A passerby was grazed by a stray bullet, but not seriously injured. The gunman, 49-year-old Luigi Preiti, was immediately tackled by police and pinned to the ground. Around him bullets littered the square.

Preiti, who had recently separated from his wife and lost his job as a bricklayer had come to Rome by train on Saturday and stayed in a cheap tourist hotel near Termini station, according to local media reports. He woke early, dressed in his best suit and tie and made his way on foot to the Palazzo Chigi where he walked up to the police perimeter and pulled a 7.65 caliber semiautomatic Beretta he bought on the black market four years earlier out of his jacket pocket and started shooting.

Later, the Italian media reported that he told investigating magistrates that his motives were “political” and that he wanted to kill himself but ran out of bullets. He shot the cops but he really wanted to kill the politicians instead. After running out of ammunition, he taunted the police: “shoot me, shoot me.”

“I’m a desperate man. I wanted to hit them, the politicians, but I know that I would not have ever made it,” he told investigators according to Italy’s news service ANSA, which is why he shot the police instead.

While the timing of Preiti’s attack was curious, it was not necessarily directly aimed at the new government, per se. Preiti told the investigators he had planned the attack more than 20 days earlier and had been fine-tuning his plans in the meantime. But Letta was only appointed as prime minister on April 24, and he only named his new ministers on Saturday. Sunday’s swearing in was not finalized until Saturday, when Preiti would have already been on his way to Rome. Still, he told the magistrates that he had studied the dynamics of the square and knew exactly where the police would be standing guard. “Everything was planned, everything,” he told the investigators, according to Italian media reports.

Reaction in Rome was swift, with the mayor quickly announcing that it was not a “terrorist attack” but an isolated incident. The swearing-in ceremony was delayed only briefly before continuing. The square was quickly cleaned and reopened to tourists by late afternoon, although stains of blood and the yellow chalk marks from forensic teams identifying where the bullets landed could still be seen on the cobblestones.

Letta, who visited the wounded police in the hospital on Sunday evening, said his government would not be deterred, but that he regretted getting started under such tense circumstances. If his first day in office is any indication of what’s ahead, Letta and his new team have their work cut out for them.