In March 2009, China blocked access to Google's YouTube due to footage showing Chinese security forces beating Tibetans. Access to other Google online services was denied to users arbitrarily.
The search engine remained operational under the condition that the government could filter the search results. In January 2010, Google announced that, in response to a Chinese-originated hacking attack on them and other US tech companies, they were no longer willing to censor searches in China and would pull out of the country completely.
Also, the government didn't "block" Dragonfly. Google terminated the project after its own employees protested it and politicians criticized it.
(All the above from Wikipedia either as direct quotes or paraphrased for brevity.)