Italy’s new government was sworn in on Sunday in a ceremony that ended weeks of political stalemate but was overshadowed by a shooting outside the prime minister’s office.

Two policemen were injured outside Palazzo Chigi, news reports said, as the swearing-in was under way at the nearby presidential palace.

The perpetrator, identified as a 49-year-old Italian man with no criminal record, was immediately apprehended and suffered head injuries after being wrestled to the ground by police. A pregnant passer-by was grazed by a stray bullet.

The gunfire sparked panic in central Rome and prompted the evacuation of the area outside the Quirinale Palace, where the new cabinet members were taking their oaths of office in the presence of President Giorgio Napolitano. It was not immediately clear whether the attack was politically motivated.

A short time later, the cabinet held its first meeting.

The new government, formed by a left-right grand coalition, would now face a parliamentary vote of confidence in the lower house of Parliament and the Senate.

The votes would formally close the book on the political deadlock that the eurozone’s third-largest economy had seen since February’s inconclusive general election.

The 21 members of the new cabinet — who come from the left, right and centre of the political spectrum — have an average age of 53, significantly lower than previous administrations.

They also include seven women, among them the first minister to have been born in Africa.

Prime Minister Enrico Letta, 46, of the centre-left Democratic Party (PD), said he was satisfied with the team, which he said features “a record presence” of women.

Anna Maria Cancellieri, interior minister in the outgoing technocratic government of prime minister Mario Monti, was appointed justice minister. Cecile Kyenge, an eye doctor who was born in the Democratic Republic of Congo, is the new integration minister.

Other notable appointments include former EU commissioner Emma Bonino as foreign minister and former Bank of Italy director general Fabrizio Saccomanni as economy minister.

Mr. Saccomanni has vowed to cut spending and taxes and introduce measures to pull Italy out of recession.

The administration is backed by Letta’s PD as well as Silvio Berlusconi’s conservative People of Freedom (PDL) and Monti’s centrists.

Mr. Berlusconi had ruled out a cabinet post but his influence is assured by the presence of his party secretary, Angelino Alfano, as interior minister and deputy prime minister.

The protest Five Star Movement (M5S) of satirist Beppe Grillo as well as the anti-immigration Northern League and small far-left and far-right parties would remain in the opposition.

The PD, PDL and M5S each obtained about one-quarter of the national vote in February’s elections with the centre-left coalition beating Berlusconi’s conservatives by a narrow margin.

Mr. Letta has vowed to put the economy and political reform at the heart of his agenda.

“A political government was the only government possible in the interest of the country and Europe,” Mr. Napolitano said on Saturday.

Napolitano had previously appointed Mr. Monti to helm a non-aligned, technocratic government after Berlusconi’s resignation in 2011 when Italy came under the spotlight of financial markets.

More In: World | International | News