Chinese dissident artist Ai Weiwei has been freed by the mainland government on Wednesday, China's official state media reported.

I'm out. I'm fine. Ai said in a text message sent to friends and associates.

Ai had been in detainment since early April, when he was seized by Chinese authorities as he attempted to travel from Beijing to Hong Kong.

After his arrest, rights groups worldwide put pressure on the Chinese government through demonstrations, protests and petitions.

The Chinese Xinhua news agency said that Ai is out on bail after admitting his guilt over charges of tax evasion and agreeing to pay the amount he allegedly owes.