The Casablanca bombings were carried out by disaffected youths from the grindingly poor neighbourhoods on the fringes of the city, Morocco's commercial capital, after being brainwashed by extremists, the authorities said.
More than 3,000 people have been arrested since the Casablanca attacks on suspicion of terrorist activity. Many have been released but hundreds have been jailed after trials.
Mohamed Ben Sahraoui,the defence lawyer for Addad and Bouizakarne, said the sentences were unfair.
"There is no proof from the courts of their guilt," Sahraoui said. "If they have explosives they must be produced ... The court didn't even ask for witnesses."
He said the defendants' statements had been extracted from them by force.