Britain is to challenge an EU agreement to slash bankers' bonuses at a meeting of European finance ministers next week after Boris Johnson condemned the proposal as a "deluded measure".

Amid fears that the EU agreement could deal a hammer blow to the City of London, David Cameron said EU regulations needed to be flexible enough to allow international banks to operate in Britain and the rest of the European Union.

George Osborne or the Treasury minister Greg Clark will represent Britain at the meeting next week to relay what No 10 described as real concerns about the proposal.

The agreement in Brussels came as the Royal Bank of Scotland posted losses of more than £5bn after paying out more than £600m in bonuses. No 10 said it had imposed cash limits of £2,000 on bonuses at RBS and Lloyds and was giving a greater say to shareholders in all banks.

The prime minister's spokesman said: "Bonuses are very significantly down on where they were in 2010. So you are seeing real responsibility and restraint."

Johnson highlighted deep British unease about the bonus agreement hammered out in Brussels on Wednesday night between officials from the EU's 27 member states, MEPs and the European commission by dismissing it as the most preposterous idea in Europe in two millennia. Under the agreement, bankers' bonuses would be capped broadly at a year's salary, although they could be doubled if a majority of shareholders agreed.

The London mayor said: "People will wonder why we stay in the EU if it persists in such transparently self-defeating policies. Brussels cannot control the global market for banking talent. Brussels cannot set pay for bankers around the world.

"The most this measure can hope to achieve is a boost for Zurich and Singapore and New York at the expense of a struggling EU. This is possibly the most deluded measure to come from Europe since Diocletian tried to fix the price of groceries across the Roman empire."

Diocletian, the 51st Roman emperor, introduced the edict on maximum prices in AD 301.

The prime minister made clear the government's unease at a meeting of Nordic leaders in the Latvian capital of Riga. "We do have in the UK – and not every other European country has this – we have major international banks that are based in the UK but have branches and activities all over the world, and we need to make sure that regulation put in place in Brussels is flexible enough to allow those banks to continue competing and succeeding while being located in the UK. So we'll look carefully at what the outcome of the negotiations was before working out the approach we'll take at Ecofin [the meeting of EU finance ministers] next week."

Downing Street made clear Britain was prepared to water down the proposal at the meeting, though any final decision will be made by qualified majority voting in which no member state has a national veto.

Cameron's spokesman said Britain had taken important steps to rein in remuneration, such as deferred payments, which has seen £300m clawed back from Barclays bonuses and 3,000 RBS employees also experiencing "clawback" as a result of the Libor investigations.

He said: "The UK believes it has some of the toughest remuneration requirements in the world. They are incentivising long-term behaviour – the idea of deferred payments, with a significant proportion in shares that can be clawed back over a period of time. At the heart of this is aligning the incentives with long-term performance and stability.

"Alongside that we of course also want a successful financial sector in the UK. There are very successful UK-based firms that compete across the world. They are an asset to the UK. When we are looking at what further regulations may be appropriate we will want to consider the impact on competitiveness.

"This idea of a cap – one of the things we have been pointing out as a potential consequence of this type of approach, if you cap variable pay – bonuses – you can see big increases in basic pay. And of course basic pay is not subject to clawback because it is paid out straight away."

Cameron said Britain was taking a responsible approach because it was implementing the Vickers proposal to ringfence the retail side of banks away from the investment side.

"We are absolutely clear that we must be able to implement the Vickers plan in the UK, which in some ways is tougher than regulations that are being put in place in other European countries. We want to have this proper ringfence between retail banks and investment banks, and the rules must allow that to happen – I think that is very important."

The spokesman added: "We do continue to have real concerns about them [these proposals] and we will continue to be discussing them with EU partners in the coming days ahead of the Ecofin."