ROME (Reuters) - Italy’s Senate passed into law on Thursday a bill allowing severely ill people to refuse treatment that would prolong their lives.

The bill passed 180 votes to 71 in the face of opposition from right wing parties. It allows all adults to prepare a document to express their preferences on how to be treated if they lose the faculty to choose or express their choice.

Some 10 years after legislation on patients’ rights to choose what care to receive at the end of their lives was first proposed, the lower house of parliament approved the bill in April.

This will be one of the government’s last acts before parliament is dissolved ahead of elections next year.

The ruling Democratic Party (PD) had pledged another civil rights measure, making it easier for the children of migrants to obtain citizenship, but this law now looks unlikely to pass.

“Parliament’s decision makes everyone takes a step forward in terms of civilization for the country and of human dignity,” Prime Minister Paolo Gentiloni, who is not a party leader and is unlikely to run in the election, said in Brussels.

By Italian parliamentary standards, the bill’s passage was relatively swift thanks to an agreement between two of the biggest parties - the PD and the anti-establishment 5-Star Movement - to vote it through.

The deal was a rare example of cooperation between the two parties, which are usually bitter enemies.

The anti-immigrant Northern League, which vies with former prime minister Silvio Berlusconi’s Forza Italia party for the most votes on the right, fiercely fought the bill. Forza Italia also opposed it, though less strongly.

“This law is a precursor to euthanasia,” said Northern League senator Gian Marco Centinaio.

Final discussion of the bill coincided with the high-profile case of a disc jockey paralyzed and blinded in a road accident who went to Switzerland to be helped to die.

A Radical party member and right-to-die activist who accompanied Fabiano Antoniani, known as DJ Fabo, to the Swiss clinic, is currently on trial in Milan for aiding suicide.

In the living wills, which can be recorded on video if the patient cannot write, food and water can be refused as well as medical treatment.

However if a patient refuses treatment, the doctor is still obliged to reduce their suffering, and can also use sedation. The law also gives doctors scope to object on conscientious or religious grounds.