Slideshow ( 4 images )

TUNIS (Reuters) - A Tunisian court jailed seven people for life on Saturday for their involvement in two deadly militant attacks in 2015, one on a museum in Tunis and the other on a hotel in a Mediterranean resort.

Other defendants received jail sentences ranging from 16 years to six months, state news agency TAP quoted court spokesman Soufiane Sliti as saying. In all, 51 suspects stood trial, of whom 27 were acquitted, in hearings that lasted 18 months.

The assault on the Bardo National Museum left 21 people dead, while 38 were killed in the beach resort of Sousse, some 150 kilometers (90 miles) south of the capital. Islamic State claimed both attacks.

The twin massacres, which took place within three months of each other, devastated Tunisia’s economy - tourism is a major earner of foreign currency that accounts for about 8 percent of gross domestic product - as major European tour operators took flight.

The attacks also acted as a brake on political reforms hailed as a model of democratic transition following its 2011 ‘Arab Spring’ uprising.

Tunisia remains one of the most secular countries in the Arab world, but authorities estimate about 3,000 of its citizens have joined Islamic State and other jihadist groups in Iraq, Syria and Libya.

Tourists have gradually returned as security has been stepped up, and Tunisia attracted a record 8.3 million visitors in 2018 as hotels were filled with holidaymakers from Algeria, Russia and other parts of Europe.