Long Beach, California (CNN) -- Google co-founder Sergey Brin on Friday said he's optimistic that his search engine will not have to pull out of China over hacking and censorship issues.

"I'm an optimist. I want to find a way to work within the Chinese system and provide more and better information," he said. "I think a lot of people think I'm naive, and that may be true."

The remarks came at the annual TED Conference of thought leaders in Long Beach, California.

Google Inc. last month threatened to pull out of China after the Gmail accounts of human rights activists were targeted and hacked, the company said.

There has been speculation that China was behind the attacks. China denies those claims, and Brin said it doesn't particularly matter whether the government was behind the attacks or not.

"Even if there were a Chinese government agent behind this, it might represent a fragment of policy, as it were," he said. "I think there are many people there and they have different views. If you look at when we entered China, in 2006, I actually feel like things really improved in subsequent years.

"We had to self-censor a fair amount, but we were actually able to censor less and less, and our competitors were able to censor less and less."

But that ended with the 2008 Olympics in Beijing, he said.

"There's been a lot more blocking going on since then," he said.

Brin maintained that his Mountain View, California, company never entered China to make money. He said Google wanted to spread information.

"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people," he said. "It's not been about our revenue or profit or whatnot."

He said the company will not continue to politically censor search results in China, which is one of the world's largest markets for the Internet. But he did say that Google would agree to censoring pornography and other potentially objectionable material.

TED is a nonprofit devoted to spreading big ideas. Some of the world's biggest thinkers, entrepreneurs and artists, including Bill Gates, Sarah Silverman and Jamie Oliver, have gathered for the group's annual conference.

Brin's remarks came during a question-and-answer session with TED's "curator," Chris Anderson.