Charges included premeditated murder, threatening national security and belonging to an extremist-linked group.
Three people received life sentences for participating in the first attack in March 2015 at Tunis Bardo Museum. Two commandos had stormed the compound, mowing down 22 people most of whom were foreign tourists.
Four other suspects received the same punishment for a second attack few months later, in June at a seaside resort where 38 people, mostly British tourists, were gunned down.
The Islamic State group (ISIS) claimed responsibility for the attacks. The defendants told the court that fugitive Chamseddine Sandi was the mastermind of both.
The ISIS fighter has been reportedly killed in an US air strike in neighboring Libya.
The court also heard six police officers accused for failing to provide support to holiday makers during the attack in Sousse.
Seifeddine Rezgui believed trained by ISIS popped up at the seaside resort with a Kalashnikov and shot people down before being slain by police.
The Saturday verdict also handed jail sentences ranging from six to 16 years to several defendants while the court acquitted 27 people.