A British MEP who challenged Spain’s description of Gibraltar as a colony has accused his opponents of “dirty tricks” after he was stripped of a key position in the European parliament.

Claude Moraes was forced out of the role of rapporteur for EU no-deal visa-free travel legislation, a position in which his job is to represent MEPs’ views, after he refused to accept the contentious description of the British overseas territory in a draft law.

The two largest groups in the European parliament – the centre-right European People’s Party and the Socialists & Democrats – forced through his removal at a hearing on Monday on the grounds of a conflict of interest.

Spain, with whom Britain has clashed over the sovereignty of Gibraltar for three centuries, had argued for the description of Gibraltar as a “colony of the British crown” in legislation, with the backing of the other 26 member states. The draft law was first put to a vote by MEPs six weeks ago.

The draft law was held up owing to Moraes’s refusal to give ground on the issue. He said he had no mandate to accept what he said was an erroneous description. Gibraltar voted to remain British sovereign territory in a referendum in 2002.

The two main political groups in the parliament said Moraes’s removal was necessary as parliament needed to ensure visa-free travel for EU and British nationals in the event of a no-deal Brexit on 12 April, the new cliff-edge date after the mini-extension of article 50 agreed by the EU leaders.

Brexit: May gives way over Gibraltar after Spain's 'veto' threat Read more

Moraes, an MEP of 20 years, said he was pleased that colleagues outside the two main groups had expressed their vehement opposition to his unseating as rapporteur.

“This denigrates the parliament, it denigrates the UK’s position in the parliament,” Moraes said. “They said that we need visa-free legislation, but that was not the problem as we had come forward with a range of compromise wording for Gibraltar. It is pretty dirty politics.”

He added: “It shows Britain’s weakness today. This is how they were able to do it. I am pleased that I did not buckle and give up. In future, others in this position, if their home country is in a weakened position, should not give up either.

“Despite all the various compromise proposals from us, we have been met with something of a brick wall … due, we believe, to Spain lobbying hard for the maintenance of the word ‘colony’ in the footnote.”

At Monday’s hearing, fellow MEPs, in six other political party groups, argued against what they described as an unconstitutional act. Sophie in ’t Veld, a Dutch MEP and deputy leader of the Liberal group, described Moraes’s removal as unprecedented.

Petr Ježek, a liberal Czech MEP, said: “I disassociate myself with this process and consider it scandalous that such a decision has been taken purely on the basis of the nationality and therefore the assumed bias of the rapporteur.”