Rajab, who had been serving a six-month jail sentence, was granted “a special pardon for health reasons,” a report by the official Bahrain News Agency said on Monday.
Nabeel Rajab was sentenced to prison in January for posting tweets deemed critical of the Al Khalifa regime.
Known internationally for his peaceful human rights work, Rajab spent two years in prison from mid-2012 to mid-2014.
In a resolution adopted on Thursday, the European Union had called on the Bahraini government to immediately and unconditionally free "all imprisoned Human Rights Defenders", including Nabeel Rajab and Sheikh Ali Salman, the secretary general of Bahrain's main opposition block al-Wefaq National Islamic Society.
Bahrain, a staunch ally of the United States in the Persian Gulf region, has been witnessing almost daily protests against the ruling Al Khalifa dynasty since early 2011, with Manama using heavy-handed measures in an attempt to crush the demonstrations.
Scores of Bahrainis have been killed and hundreds of others injured and arrested in the ongoing crackdown on the peaceful demonstrations.