By Steve Scherer

ROME (Reuters) - An Italian judge acquitted two men accused of people smuggling and murder, saying they had been forced at gunpoint by Libyan traffickers to drive a rubber boat packed with migrants last year.

A judge in the Sicilian city of Palermo on Wednesday ordered that Jammeh Sulieman and Dampha Bakary, from Senegal and Gambia respectively, be released from prison, according to a copy of the ruling.

Hundreds of similar cases are pending in Italy, and the ruling may have set a "historic" precedent, said one of the defense lawyers in the case.

The two were accused of both people smuggling and murder because 12 people died during the attempted crossing in July 2015 when the rubber boat they were driving started to deflate. The prosecution had sought life sentences for both.

The other migrants on the boat were rescued by an Italian coastguard vessel, along with the accused smugglers, who were taken into custody when the rescue ship reached Palermo.

"The defendants did not autonomously and freely set out in the Mediterranean at the helm of a flimsy boat impossibly packed with people," Judge Gigi Omar Modica wrote in his ruling.

Libyan people smugglers forced them to take the helm at gunpoint, and then handed them control of the boat only after it had taken to sea. If they had turned back, it "would have meant certain death at the hands of the Libyans", Modica said.

NO RETURN TO LIBYA

Palermo prosecutors Claudio Camilleri and Maurizio Scalia said they planned to appeal the decision. In Italy, both prosecutors and defendants can appeal court rulings.

Almost 800 suspected "scafisti" or "boat smugglers" were arrested in the 12 months to July, the Interior Ministry said in August. More than 700 were arrested in the previous 12 months.

"I have many clients who are accused of driving the boats, and it's always the same story," Cinzia Pecoraro, one of the two defense lawyers, told Reuters on Thursday.

Armed men take them to the boats, start the engines, load migrants onto the vessels and then accompany them as they set out to sea. Before abandoning the boat and returning to shore, they tell the drivers they will be shot if they return to Libya, she said.

"Now courts can look at each case with this sentence in mind," Pecoraro said.

Mass migration to Europe from Asia, the Middle East and Africa is now in its third year, and Italy has been on the front line since it started in 2013. Hundreds of thousands have set out fleeing violence and poverty at home.

(Additional reporting by Wladimir Pantaleone in Palermo; editing by Ralph Boulton)