ROME -- Two military police officers were shot and wounded on Sunday in a crowded square outside the office of Prime Minister Enrico Letta and near the presidential palace, where his new government was being sworn in.
The shooting was shown live by the state broadcaster RAI, which had a television crew in the square in front of Mr. Letta's office, Palazzo Chigi, where the new ministers were to go after the swearing-in ceremony.
What was supposed to be a day of celebration, marking a government that took nine weeks after the elections to assemble, quickly turned into a national drama. The square in front of Palazzo Chigi was cordoned off, and ambulances and police cars blocked traffic in one of Rome's busiest downtown areas. Inside the palace, the ceremony continued undisturbed, and most of the ministers were not told of the shooting, which occurred about half a mile away, until after the ceremony.
A man, identified as Luigi Preiti, who is unemployed and is from the Piedmont region, was detained and accused of the shooting, the authorities said.
"I heard seven or eight shots," said Enrica Agostini, an RAI reporter. "I was pushed back into Palazzo Chigi. The police was screaming, 'It's an attack, it's an attack.' "
Doctors at Rome's Umberto I Polyclinic said Sunday evening that one of the military police officers, Giuseppe Giangrande, was shot in the neck and was in critical condition after undergoing an operation. The bullet injured his spinal column, causing "important damage," doctors said in a televised news conference, adding that they would not be able to discuss his prognosis for 72 hours.
The other officer, Francesco Negri, was shot in leg, but his injuries were not life-threatening, officials said. A woman who was passing by was also hit but was not seriously injured, according to news reports.
At a news conference, Interior Minister Angelino Alfano said an investigation would be conducted but that the shooting appeared to be an "isolated gesture."
Mr. Alfano said it also appeared that Mr. Preiti had intended to commit suicide, but told officers that he had run out of bullets.
A prosecutor working on the investigation said that Mr. Preiti had intended to target politicians. "He's a man full of problems who has lost his job, he'd lost everything, he'd had to move back home, he was desperate," the prosecutor, Pierfilippo Laviani, told the news agency ANSA. Mr. Preiti had planned the attack 20 days ago, according to news media reports.
"He wanted to strike politicians, but when he couldn't reach them, so he shot the police," Mr. Laviani said.
After the swearing-in ceremony, Mr. Letta met with his ministers for a cabinet meeting that had been scheduled beforehand. The new government will face a confidence vote in Parliament this week.
The former interior minister, Anna Maria Cancellieri, who was sworn in on Sunday as justice minister, told reporters that the shooting had been carried out "by someone who is unbalanced."
The shooting rattled Italy, already unsettled by a period of instability after the inconclusive national elections, which hobbled efforts to form a government. It also brought back memories of the "years of lead," the period of social and political turmoil in the 1970s and early 1980s marked by dozens of acts of terrorism that were carried out by left-wing and right-wing radicals.
In recent years, groups that modeled themselves after the Red Brigade terrorists of that time have carried out sporadic attacks and have killed two Italian labor reform specialists. And tax agency offices have been bombed, a protest against a fiscal system that many consider to be onerous. But there has been little social tension of the kind that marked Italy a few decades ago.
Rachel Donadio contributed reporting.
This article originally appeared in The New York Times.