He is already serving a three-month sentence he received in July over comments on social networking websites.
Mr Rajab, president of the Bahrain Centre for Human Rights, had previously been detained several times.
He was one of the organisers of pro-democracy protests which have rocked the Gulf kingdom since last February.
Mr Rajab's lawyer Mohammed al-Jishi said three year-long sentences had been handed down on three separate counts.
Mr Jishi said he plans to appeal against the ruling.
Fellow activists immediately condemned the decision, with some members of the protest movement calling for demonstrations on Thursday evening.
Mr Rajab's sentence in July came after prosecutors received complaints that he had libelled residents of the town of Muharraq on Twitter.
He wrote on Twitter, where he has more than 155,000 followers, that Prime Minister Sheikh Khalifa bin Salman al-Khalifa should step down, and that Muharraq residents had only welcomed him during a visit because he had offered them subsidies.
Mr Rajab's appeal in that case has been deferred to 23 August, according to Mr Jishi.
Last week, several members of the US Congress wrote to the Bahraini King Hamad al-Khalifa expressing concern over Mr Rajab's case and urging the release of "Bahrainis being held for crimes related to freedom of expression".
Prominent Bahraini human rights activist Nabeel Rajab has been jailed for three years for taking part in "illegal gatherings".