An unemployed man who had ‘“lost everything” today opened fired outside the Italian Prime Minister’s office in central Rome, injuring two police officers and a pregnant woman.

Police arrested the attacker as he tried to flee the scene outside Palazzo Chigi at the same time as the Prime Minister, Enrico Letta, and his new cabinet were being sworn in half a mile away at the President’s palace.

One of the injured Carabinieri officers was shot in the leg and the passer-by suffered a slight injury from a ricochet. The second police officer, a 50-year-old brigadier who was shot in the neck, was said to be in a serious but not life-threatening condition tonight.

Download the new Independent Premium app Sharing the full story, not just the headlines

Rome’s public prosecutor, Pierfilippo Laviani, said after interviewing the man that he had wanted to “shoot politicians”.

“He has confessed everything. He doesn’t seem like a mentally unbalanced person. He was a man full of problems. He lost his job, he’d lost everything,” he said.

The new deputy Prime Minister and Interior Minister, Angelino Alfano, said after the swearing-in ceremony that the shooting was a “tragic and criminal act”, and an “isolated incident by unemployed man”. Mr Alfano said the man “showed immediately afterwards the intention to kill himself but it appears he was unable to do so because the gun was empty”.

The gunman was named as Luigi Preiti, a 49-year-old originally from the southern Italian town of Rosarno. State TV reported one police officer at the scene as saying the arrested man had shouted: “I’m sorry. Shoot me now.”

The gunman’s brother, Arcangelo Preiti, was quoted in the Italian press denying suggestions the attacker had mental health problems: “No, it’s not true. My brother doesn’t have any problems. Until this morning he was lucid and resourceful.”

The arrested man’s employment status will have significant resonance for Rome’s new government. Joblessness is soaring in recession-mired Italy, and a series of suicides linked to the economic crisis have hit the headlines in recent months. Creating economic growth – and jobs – will be a key priority for the incoming government.

This morning, at the President of State’s office, the outgoing caretaker premier Mario Monti handed over the symbolic bell to the incoming Prime Minister Enrico Letta, as Italy passed from one non-elected administration to another.

Mr Letta, 46, a moderate from the centre-left Democratic Party, was asked to form a government by President Giorgio Napolitano after two months of parliamentary deadlock. He surprised many this weekend by naming a young cabinet with seven women and the first black minister in Italy’s history, the Congolese-born medic Cécile Kyenge, who is the new Minister for Integration.

Later this week his government is likely to face the confidence vote it needs to pass to begin parliamentary business. General support from the centre-left and centre-right blocs should ensure it wins this vote.

But, despite murmurs of approval at the selection of a young and politically moderate team, Mr Letta must now spell out how his unlikely coalition will work together to reform the country’s corrupt and sclerotic institutions and drag Italy out of its downward economic spiral.

He has already indicated he also wants to move away from the austerity imposed by his predecessor Mr Monti, although it’s not clear how much the cabinet will agree on economic policy.

The conservative ex-premier Silvio Berlusconi, who will wield major influence on the new government from behind the scenes, has frequently criticised the austerity measures demanded by Europe, indicating that a change in economic policy is likely. The anti-establishment Five Star Movement led by Beppe Grillo has effectively been sidelined in parliament, at least for now, after insisting it would not work with the traditional political parties.