HSBC’s chief executive defended the British bank’s actions in Hong Kong, including supporting a controversial national security law and freezing the accounts of activists, during questioning by UK politicians who accused it of “endorsing” China’s erosion of democracy in the city.

Noel Quinn was told his bank was “aiding and abetting one of the biggest crackdowns on democracy in the world” by Labour MP Chris Bryant during a hearing of the parliamentary foreign affairs committee on Tuesday.

The chief executive had been summoned to explain a decision to freeze the account of former Hong Kong lawmaker, Ted Hui, who was arrested in connection with protests in the city in May last year. Mr Hui had received a letter from Mr Quinn this month explaining the bank had taken the action at the request of the police.

Mr Quinn told MPs he was “not in a position as a banker to be able to judge the motives or validity of [a] legal instruction from a law enforcement authority”, nor was it his “position to make a moral or political judgment on these matters”.

He added that HSBC had acted not out of a fear of the consequences for disobeying the request to freeze some customers’ funds, but that “as a CEO I cannot cherry pick what law to follow or not”.

In an often tense hearing, MPs accused HSBC of being “judge and jury” of its customers in relation to clashes between protesters and police in the territory.

The lawmakers also asked why HSBC had refused to take a moral stance on the treatment of the population of the former British colony, despite increasing calls for businesses to behave responsibly and the lender expressing views on other issues such as climate change.

In recent years HSBC, which makes around two-thirds of its profits in Hong Kong, has been caught in the middle of mounting geopolitical tensions between the UK and Beijing as China intensified its crackdown.

The lender was criticised by the US, UK and shareholders last year when its top Asia executive, Peter Wong, publicly endorsed a controversial national security law imposed by Beijing on Hong Kong.

Speaking to MPs, Mr Quinn denied that Mr Wong’s decision to sign a petition in support of the security law was a political act. “Peter was not advocating for a particular party or particular policy,” he said.

Mr Quinn also stood by a statement he made last year that “called for the security position in Hong Kong to be stabilised”.

HSBC was founded in Hong Kong 155 years ago, but moved its headquarters to London when it bought Midland bank in 1993.

Mr Quinn acknowledged he was “troubled about the challenges that Hong Kong has faced over the past two to three years” and that sometimes working with certain governments around the world was “extremely challenging”.

However, when asked if there would be a moment when he would be willing to walk away from Hong Kong over geopolitics and changes to the legal system, the chief executive said the bank was “nowhere near that point” and was “too committed as an institution through our heritage and history”.

“We are not in Hong Kong purely because of profit . . . [and] it is not a matter for me to choose China over another political system like the UK,” he added.

“We are trying to stay out of the politics of one country versus another . . . there is no benefit to me or HSBC in walking away from the community in Hong Kong at the moment. I would only harm Hong Kong, not help it.”