One defendant was jailed for 15 years and another for five years, while two others were sentenced to one year in prison each, the prosecution said in a statement carried by BNA state news agency.
The four faced charges including "resisting police, possessing fire arms and ammunition for terrorist aims, attacking others and threatening to use fire arms," the statement said.
The case goes back to March last year, it said.
Bahrain has been shaken by unrest since it quelled a month-long Shiite-led uprising demanding reforms which erupted on February 14, 2011.
Despite the crackdown on the 2011 uprising, protesters frequently attack police in Shiite villages outside the capital Manama.
Around 20 people were given jail terms of varying lengths last month in cases involving attacks on police and a bus, as well as a "terrorist" plot.