Barclays chief executive Jes Staley avoided a nightmare scenario at the lender's annual general meeting (AGM), where he received the backing of a significant number of shareholders.

Crucially, however, some 16% of Barclays' shareholders did not back Staley, who earlier in the day had apologised for attempting to identify a whistleblower, which rocked the bank and saw him investigated in the UK and in the US.

The 60-year-old, who has been embroiled in a whistleblowing scandal, received 97.2% of votes in favour of his re-election on a 62.6% turnout.

Chairman John McFarlane said it wouldn't have been "just" to fire Staley over the scandal, adding the latter's inexperience in a CEO role had been factored in by the board.

"The punishment for going through a red light is not to lose your license," McFarlane said. However, "we will address his compensation" appropriately, he added.

Speaking at the AGM on Wednesday (10 May), Staley admitted he had "made a mistake" and had broken the rules.

"I made a mistake in becoming involved in an issue which I should have left with the business to deal with. I have apologised to the board, and I would today like to apologise to you as well for that error," he told investors.

Last month, the Financial Conduct Authority (FCA) began a formal investigation into Staley's handling of the bank's whistleblower scandal, which is also being probed by the Prudential Regulation Authority (PRA).

According to the FCA, Staley's attempts to unmask the whistleblower, who raised concerns about a senior employee at Barclays who had been recruited earlier in 2016, were in contravention of the bank's procedures on whistleblowing.

Barclays's board hired law firm Simmons & Simmons to investigate the letters last year, but it said that it only came to know of the chief executive's efforts to identify the author in early 2017.

The bank said the anonymous letters raised concerns of a "personal nature" about the unnamed senior employee hired by Barclays in 2016, and Staley's knowledge of and role in dealing with those issues at a previous employer.

Staley, who had apologised for his conduct even before Wednesday's AGM, considered the letters an "unfair personal attack" on the employee in question.

However, influential advisory group Institutional Shareholder Services told investors to opt against re-electing the CEO because his personal involvement and accountability in the matter, while the bank's board, led by McFarlane, has publicly reprimanded Staley for his actions.

Corporate governance body Pirc, which advises largest institutional investors, had also encouraged to vote against the bank's remuneration report, indicating Staley's pay was "inappropriate". The Barclays CEO's salary last year was 49 times higher than that of the average Barclays' employee and therefore "inappropriate".

Despite the apology, Staley could still lose his job, should the regulators opt to strip him of his approved status.

Meanwhile, the 60-year-old who joined Barclays in 2015, also quelled fears over the Brexit impact on the FTSE 100-listed lender.

"We do not currently see a need in our options to shift British jobs or significant operations elsewhere," he said. "If we require a build-up of capability in another European Union jurisdiction as part of our plans then we can do so and we will."

Last month, Staley warned lenders were likely to struggle to get the complete picture of Britain's trading terms with the other 27 EU members in time to safeguard their links with the customer on the continent.

However, he told shareholders the issues of passporting rights – which allow banks to operate in an EU country, or a state member of the European Economic Area (EEA), to conduct business across the union – was manageable.

"The first thing to say is that we see this as a wholly manageable challenge," he said. "Our investment banking activities in Europe are certainly important to Barclays and to our strategy, and we're committed to remaining a strong participant in that marketplace.

"We believe that the value of the single market for financial services in Europe with full participation from banks based in the UK remains the best option for the UK economy and the best option for the European Union economy. Nevertheless, we recognise that there are a range of possible outcomes in the negotiations over the next 23 months."