They were among 21 opposition figures tried by a special security court. Others got sentences of up to 15 years.
Ahead of the verdict, Shia protesters blocked roads and staged rallies.
Bahraini protesters have been calling for democratic reforms and rights.
A wave of protests swept the country in February and March. Emergency law was only lifted on 1 June.
Correspondents say the sentencing threatens to reignite simmering tensions in the tiny Gulf state.
Among those sentenced are:
• Abdulhadi al-Khawaja - one of the country's leading human rights activists (life sentence)
• Abd al-Jalil Singace, head of the Shia-dominated Haq Movement for Liberty and Democracy (life sentence)
In addition to the life sentences, 10 activists were given 15 years in jail, two others were given five years and one man received a one-year jail term.
End item/ 129