Mr Berlusconi says he is the target of a politically motivated judiciary
Italy's parliament has given its final approval to a controversial immunity bill put forward by Prime Minister Silvio Berlusconi's government.
The bill was passed by 171 votes to 128 by the Senate. The lower house backed the measure earlier last month.
The bill protects top public officials, including the prime minister, from prosecution while they are in office.
Critics say it is tailor-made for Mr Berlusconi, who faces a corruption trial. The PM says he is innocent.
The 71-year-old media tycoon has been charged numerous times for corruption, tax fraud and illegal party funding.
Mr Berlusconi - who has never been convicted - has criticised the court cases, saying they are a result of a witch-hunt against him by the judiciary.
'Endless' court hearings
The bill grants immunity to the incumbents of Italy's four highest state posts - the president, the prime minister and the speakers of both houses of parliament.
It must be signed by President Giorgio Napolitano before officially going into effect.
The bill's supporters have argued that the amendment is needed to allow the top state officials to focus on doing their jobs - without legal destraction.
Mr Berlusconi currently faces a corruption case in Milan.
The Italian prime minister also faces prosecution in Rome for alleged collusion between his Mediaset network and state broadcaster, Rai.
Mr Berlusconi claims that he has attended 2,500 court hearings, had 587 police visits and spent some 174m euros (£135m; $271m) in legal fees since entering the political scene 14 years ago.