The European Parliament's justice committee approved the text of the law that already had the backing of member states and should now be formally confirmed.
Britain is due to leave the European Union, perhaps as early as next week, but The law allows British visitors 90-day trips to the Schengen passport-free zone.
Implementation will depend on Britain according EU citizens reciprocal rights, but it has said it will do so and the principle of the law has broad support.
Nevertheless, the text itself triggered a bitter row in Brussels, after member states — at Spain's urging — referred in a footnote to the draft to Gibraltar as a “colony of the British crown”.
The United Nations does legally list Gibraltar as a “non-self-governing territory” under colonial rule, but Britain insists it is part of “the UK family” and that its citizens freely voted to remain British.
Britain's decision to leave the EU has revived controversy over Spain's long-standing claim on the territory, against the backdrop of Spanish elections.
But with Brexit day looming, and lawmakers rushing to complete preparations, EU leaders acted to elbow aside the British MEP at the head of the justice committee.
'April 12th is coming'
This allowed a Bulgarian colleague to nod through the text under protest, and lawmakers approved the law by 38 votes to eight, all but ensuring its passage.
On Monday, the law's “rapporteur”, British MEP Claude Moraes, was forced to step aside after EU leaders concluded that he had a conflict of interest.
Members protested this amounted to an attack on parliament's prerogatives, but Moraes' Bulgarian colleague Sergei Stanishev nevertheless steered the law through, arguing that “April 12 is coming”.
British Conservative MEP Daniel Dalton, a committee member, reacted angrily.
“The EU likes to speak the language of self-determination and democracy, but the EU's justice committee has voted to ignore that today,” he tweeted.
“No-deal Brexit legislation on visas just passed. The text falsely asserts that Gibraltar is a colony.”
But a leading Spanish MEP, Esteban Gonzalez Pons, seized upon the law as a diplomatic victory for Madrid.
“Spain has obtained fundamental support from the European institutions in the dispute over Gibraltar by considering this territory a colony,” he argued.
“The mention of Gibraltar as a colony will be fundamental in attempting to resolve the dispute over this territory in a post-Brexit scenario.”
Brexit itself will not change the status of Gibraltar, but Madrid has been keen to establish that it will retain a veto over any future agreement between Britain and the EU that touches on the territory.
By AFP's Toni Cerdá