Google's indexing of extremist websites helps police track their activity and will continue, the company's chief told an audience at the Hay festival.

Eric Schmidt, executive chairman of Google, was asked to act to take down terrorist-sympathising websites from his search engines during a question and answer session at the literary festival on Saturday.

This weekend MPs, including the Labour politician Paul Flynn, called on the company to prevent searches listing sites for groups such as the Islamist organisation Al Shabaab.

Schmidt said: "We cannot prima facie identify evil and take it down. We have taken the decision that information if it's legal, even if it's despicable, will be indexed."

He went on to argue that extremists are usually possible to detect through their internet activity and that their online presence can sometimes help.

"Extremists are not clever enough not to be found out. They leave a digital trail the police can follow," he said, after an interview with the mathematician Marcus de Sautoy.

Schmidt put the ball firmly back in the court of government when it came to questions raised this month about corporate tax avoidance, following criticism that Google does not pay a fair level of tax in Britain. Answering a question posed from an impassioned audience member, he said: "I am rather perplexed by this issue. The international tax regime has been around a long time. No rational computer scientist would have erected such a system."

He said that decisions about these matters should be taken by elected governments and not companies. "Under US law we have a fiduciary responsibility to do what we're doing. We understand the complaint but we can't fix it. The British government can fix it," he said.

Asked if Google is now more powerful than many countries and whether it in effect operates just like one, Schmidt said it was not an aim of the company. "We're not becoming a state. We don't want to be because states have a lot of complicated problems.

"On the whole, it is a fight between the internet community and government who do what they want to do. We can't force governments to do what we want," he said.