A judge has ordered the Metro Vancouver city of Surrey to immediately stop ticketing and fining Uber drivers.

The city had been issuing $500 tickets to drivers, arguing that they were operating without a business licence.

However, Uber claimed in court that drivers held the appropriate provincial permits and Surrey had not created a municipal licence that its drivers could apply for.

Uber filed for an injunction against Surrey and a British Columbia Supreme Court judge ruled in favour of the ride-hailing company.

Justice Veronica Jackson also ordered that the city pay Uber’s court costs.

Surrey Mayor Doug McCallum said in a statement after the ruling that the city will work with the TransLink Mayors’ Council on a regional business licence to ensure there is a level playing field between ride-hailing companies and taxis.

The Canadian Press