The prominent Bahraini human rights activist, Nabeel Rajab, has been freed after three weeks in detention.
Mr Rajab was detained on 6 June on suspicion of using social networking websites to publicly insult residents of a Sunni-dominated district for their ties to the royal family.
It is the second time in two months that he has been arrested and released.
Mr Rajab has helped organise many pro-democracy protests, which have been led by the Gulf kingdom's Shia majority.
He is also one of the most well-known activists in the Arab world, frequently speaking to the world's media and having more than 150,000 followers on Twitter.
Shortly after his release on Wednesday, Mr Rajab told the Associated Press news agency that he would "keep defending the people's rights".
The president of the Bahrain Centre for Human Rights was arrested after alleging on Twitter that residents of Muharaq had welcomed the prime minister during a visit because he had offered them subsidies.
Prosecutors said they had received complaints that Mr Rajab had "talked on social networks about the people of Muharaq in a way that questioned their patriotism and insulted them".
Mr Rajab is now facing trial on four separate charges - two for posting comments on Twitter deemed insulting to the government and the Sunni community, and two others relating to protests.