Democratic Party deputy leader (PD), Enrico Letta, becomes prime minister at the head of a "grand coalition" including Silvio Berlusconi's People of Freedom party (PDL).
The swearing-in signals the end of two months of political deadlock.
Away from the ceremony, outside the PM's office, two police officers were injured in a shooting incident.
Giuseppe Giangrande, 50, was shot in the neck and is described as being in a serious condition.
The second officer, 30-year-old Francesco Negri, suffered a serious wound to the leg and he remains in hospital. A pregnant woman was also slightly hurt. All three are being treated in hospital in Rome, according to Italian news agency Ansa.
A 46-year-old man, named as Luigi Preiti, was arrested at the scene. Prosecutors said he had confessed to targeting politicians, angry that he had lost his job.
Rome Prosecutor Pierfilippo Laviani said he "wanted to shoot politicians, but given that he couldn't reach any, he shot the Carabinieri".
Former PD president Rosy Bindi said: "This has its roots in an increasingly widespread social desperation.
"The dramatic problems the country is living through call for strong, radical decisions."
Since February's inconclusive poll there has been political stalemate in Italy, which is still plagued by economic woes after becoming one of the first eurozone victims of the global financial crisis of 2008.
The shooting happened about 1km (0.6 miles) away from the swearing-in ceremony, where, beginning with Mr Letta, the 21 new government ministers stepped forward one by one to receive the oath of office from President Giorgio Napolitano.
Correspondents say the "grand coalition" between Italy's current main right- and left-wing parties is unprecedented, and will probably prove an uneasy alliance.
By David WilleyBBC News, Rome
A new wave of political optimism reigns, after dire predictions of the possible institutional and economic collapse of the eurozone's third largest economy.
With their backs to the wall, the seriously fractured Democratic Party, and Silvio Berlusconi's People of Freedom Party decided to bury their ideological differences and will now try to co-operate in a last-ditch attempt to remedy a social and economic crisis that threatened to get out of hand after an indecisive February election.
The history of the very few "grand coalition" experiments in Italy since World War II does not inspire hope for long-term success.
But Italy's former ruling parties, which monopolised power in Rome for many decades after the end of WWII, have long since disappeared.
Optimism greets Italy's grand coalition
Mr Berlusconi will not be a minister but had pushed for leading figures from his party to be given top posts.
Mr Alfano, the PDL's secretary and one of Mr Berlusconi's closest political allies, is deputy prime minister as well as interior minister in the new government.
Among the other key appointments are Bank of Italy director-general Fabrizio Saccomanni to head the powerful economy ministry.
The cabinet is to have more women than usual, including former European commissioner Emma Bonino as foreign minister.
Other women given government jobs include Olympic kayaker Josefa Idem who becomes minister of equal opportunity and sports, and Anna Maria Cancellieri at the ministry of justice.
The new minister of integration will be Cecile Kyenge, a doctor originally from the Democratic Republic of Congo.
President Napolitano said on Saturday that the government would have the support of both chambers of parliament.
"I hope that this government can get to work quickly in the spirit of fervent co-operation and without any prejudice or conflict," he said.
"It was and is the only possible government."
The BBC's David Willey, in Rome, says the new government has to deal with a rapidly declining economic situation, rising unemployment - particularly among the under-35s - and lack of growth, despite some draconian austerity measures passed by the previous government of technocrats.
Mr Letta, 46, is considered a moderate within the PD and is linked to Mr Berlusconi through his uncle, Gianni Letta, who is one of Mr Berlusconi's closest aides.
Mr Berlusconi is still contesting charges of tax fraud and sex with an underage prostitute, but recent opinion polls suggest his popularity has increased, giving him greater bargaining power.
Mr Letta expressed "sober satisfaction over the team we put together".
His candidacy for prime minister emerged after the PD leader, Pier Luigi Bersani, announced his resignation following a party rebellion over his choice for Italian president and his refusal to work with Mr Berlusconi.
The third strongest force to emerge from the Italian election, the Five Star Movement led by former comedian, Beppe Grillo, has refused to take part in a coalition with the two main parties.
President Napolitano, who is serving an unprecedented second term, has suggested he might resign if the new government fails to enact reforms.
A new Italian government has been sworn in at the presidential Quirinale Palace in Rome.