Bahrain's king has pardoned an outspoken Bahraini human rights activist after three months in prison, citing health reasons.

Nabeel Rajab, who is president of the Bahrain Center for Human Rights, had been under arrest since April 2 on charges related to comments he made online criticizing the treatment of political prisoners at a prison in the Arab Gulf country.

He also faced a six-month sentence for insulting defense and interior ministries on Twitter when he alleged that Bahrain's security institutions were incubators for extremist ideology after several former of the country's security officials apparently joined the extremist Islamic State group.

The official Bahrain News Agency reported that Rajab's was released Monday.

He is a member of Bahrain's Shiite majority, which has been demanding greater rights from the Sunni-led monarchy.