DUBAI (Reuters) - A Bahrain appeals court on Thursday overturned the conviction of a rights activist over a tweet involving the prime minister, his lawyer said, but he remained in jail for other offences.

Bahrain, where the U.S. Fifth Fleet is based as a bulwark against Iran and any threats to Gulf oil shipping, has been in turmoil for 18 months with majority Shi'ite Muslims agitating for democratic reforms in the Sunni-ruled kingdom.

Nabeel Rajab, founder of the Bahrain Centre for Human Rights, was sentenced in July to three months in prison for suggesting via Twitter that residents of al-Muharraq district had made a show of support for Sheikh Khalifa bin Salman Al Khalifa, the prime minister, only for financial gain.

"The judge ruled his innocence. Nabeel and representatives of many foreign embassies were present. I was able to meet him for a few minutes," lawyer Mohammed al-Jishi told Reuters.

The state news agency BNA said the judge had acquitted Rajab because he was not satisfied with the evidence put forward.

Rajab has led many demonstrations calling for a reduction in the powers of the Al Khalifa dynasty which has long ruled the Gulf Arab state. Analysts see the prime minister as a pillar of resistance to opposition demands.

A hero to protesters but a villain for those who fear unrest could bring Shi'ite Islamists to power, Rajab was sentenced to three years in prison last week on three charges of leading demonstrations. Prosecutors said Rajab had incited violence against police.

Rights groups and Western governments have criticized that conviction and the appeals court is due to examine it on September 10.

"The verdict (on Thursday) was an easy way out for the authorities after handing Rajab a three-year jail sentence last week," said Brian Dooley of U.S.-based Human Rights First.

"They admit their mistake in convicting him for the tweet, but he still goes back to prison."

Rajab's opponents predicted that Rajab would be freed in the protest cases because of pressure from the United States. "An order declaring his innocence is coming from the U.S. embassy," wrote Sunni cleric Mohammed Khalid on Twitter.

Shi'ite-led unrest has persisted since a period of martial law last year that put down the uprising. The two sides accuse each other of responsibility for almost daily street violence.

Opposition parties led by the Shi'ite group Wefaq are demanding full powers for the elected parliament to legislate and form governments. Many Shi'ites complain of political and economic marginalization, a charge the government denies.

In response to the unrest, the Al Khalifas have increased parliament's powers of scrutiny over ministers and say policing is being revamped to conform with international standards.

The United States has pushed Bahrain's rulers to resolve the conflict through talks, but it values close relations with the ruling family that allows the U.S. Fifth Fleet to run its operations out of a Manama base.

Bahrain has been caught in a regional competition for dominance between Iran and U.S.-backed Saudi Arabia. Riyadh sent troops to shore up the Bahrain government last year, and Iran has championed the opposition cause while denying accusations it is orchestrating the unrest.

Fifth Fleet warships help ensure oil exports flow freely out of the Gulf. Iran has threatened a blockade if its protracted stand-off with Western powers over its disputed nuclear program degenerates into conflict.

(Writing by Andrew Hammond; Editing by Sami Aboudi and Andrew Roche)