One of UK’s voting defeats at the council was when George Osborne was unable to stop a cap on bankers’ bonuses.
Photograph: Olivier Hoslet/EPA

The UK was on the winning side in the European Union council in four out of five votes in the run-up to the Brexit referendum, even though some Eurosceptic ministers “wanted to be out-voted” according to a UK source.

The British government voted with the rest of the EU in 82% of votes in the two years before the Brexit vote, according to a Guardian analysis of data collected by VoteWatch Europe.

But insiders believe British opposition in the council of ministers increased ahead of the referendum, as Eurosceptic cabinet ministers sought to show the UK could not win in the EU.

“As people [ministers] looked ahead to the referendum, they increasingly wanted to put the case that Britain was no longer getting its own way, so they wanted to be out-voted, in a way,” said one person familiar with the matter.

“They wanted to be systematically unsatisfied with everything.”

After David Cameron and the coalition government came to power in 2010, the UK was more likely to vote no in the EU council of ministers.

Is the UK a winner or loser in the EU Council?

The Guardian has looked at 154 votes in the council from the start of the European parliament’s current term in July 2014, until the referendum day in June 2016. During this time, the UK recorded 12 no votes, 14 abstentions, and used its opt-out on EU justice and home affairs policy eight times.

Made up of officials and ministers from all 28 member states, the council of ministers is one of the EU’s most powerful institutions, but its opaque workings mean it is far less visible than the European commission or the European parliament.

Countries have a veto on tax, defence and foreign policy, but large areas of EU law, such as environment, fisheries, farming, consumer policy and transport, are decided by qualified majority votes.

The European court of justice was the cause of two other British defeats, when an increase in the number of judges was passed despite British opposition. Proponents argued more judges were needed because of the court’s increasing workload.

Most of the contentious laws never hit the headlines, such as the UK’s no vote to an update of the EU’s railway safety law, or its opposition to amending the European statistics regulation.

The government chalked up two defeats on legislation to fund pan-European political parties and foundations, reflecting British antipathy to giving more money to the European parliament. It later emerged that Eurosceptics, including Ukip, were misspending these funds.

Council votes are an imperfect guide to national influence. Some countries have a policy of never being outvoted – France abstained only once during the period the Guardian studied. Others, including the UK, prefer the theatrical gesture of a no vote to register displeasure.

Some argue Cameron’s ministers declared their opposition too early in the EU law-making process, losing the chance to influence other countries.

“Ministers, who don’t really understand the European Union – which was most of them – didn’t always understand ... that [lead negotiators] are only going to negotiate in British interests if they are nervous about whether our vote is still in play,” said the source.

Henry Newman, a former adviser to Michael Gove, thinks voting record statistics exaggerate British influence in the EU.

“There were various times when we either abstained or voted in favour of policies we were broadly opposed to because other political considerations came into play,” Newman said.

Ahead of David Cameron’s renegotiation “there was a strong pressure from the centre not to upset other member states by opposing policy decisions”, he added.

But Simon Fraser, who ran the Foreign Office until 2015, says it is “simply not credible” that ministers were instructed to vote in favour of policies the UK opposed.

“Why would we do that? What would be the purpose?” he asked.

“After 2014 our government said we were going to have a referendum on the European Union, we were also engaged in seeking to withdraw from significant parts of legislation, for example in justice and home affairs. It would be hardly surprising if our ability to build alliances and get our way was somewhat weakened.”

“Our record when it came to qualified majority voting of being on the winning side is very strong overall,” he added.