Uber has hit a major roadblock in Europe's largest economy.

A German court ruled Wednesday that Uber violates the nation's taxi laws and has imposed a nationwide ban on the ride-sharing service, uberPOP.

The Frankfurt regional court sided with Taxi Deutschland, a taxi union that has been fighting Uber in the courts since August 2014.

The taxi union argued that uberPOP, a service that connects drivers with passengers via a smartphone app, is illegal and unsafe because the drivers aren't professionals.

"We are pleased to say that justice has been reinstated today," said Dieter Schlenker, chairman of Taxi Deutschland. "Again, a court determined [that] Uber based its business model on a breach of law."

Related: Uber wants to hire 1 million women

Uber said it respects German law and is waiting to hear the court's reasoning. It is planning to appeal the ban.

In a statement, Uber said the ban "represents a fundamental infringement" of its rights under European Union law. It has lodged a complaint against Germany with the European Commission.

Uber added that its UberBLACK and uberTAXI services are not affected by the ban. Those services use professional drivers.

An Uber spokesman said the ban on uberPOP will not officially take effect until Taxi Deutschland pays a 400,000 euro security deposit.

This is not the first time Uber has faced a challenge in court. Taxi unions in France, Spain and the Netherlands have sued to block the San Francisco-based company from expanding.

Related: Uber's global ambitions hit roadblocks

Related: Don't bet on the death of taxis just yet

Editor's Note: The headline on this story has been changed from an earlier version to clarify the ban applies to uberPOP.