NEWARK - After a public war of words, Uber and the City of Newark have struck a landmark deal that will keep the ride-hailing service in operation.

The city had said if Uber didn't play by the rules, then the company and others like it would face penalties, including fines, tickets and towing. Uber responded by saying it would quit Newark, eliminating the chance for its drivers to pick up fares at Newark Liberty International Airport.

As part of the agreement, Uber will pay $1 million a year for 10 years to the city to keep its drivers at the airport. The company will also provide $1.5 million in commercial liability insurance for drivers that work under the Uber platform. Additionally, there will be background checks on their drivers.

"Uber is proud to be the first ride-sharing company to reach a compromise with the City of Newark that allows our driver-partners and riders to continue to use our app," the company said in a statement. "The agreement framework released by Mayor  [Ras]  Baraka is a model for the state Legislature."

Previously, Uber had blasted Baraka's proposal this week to make ride-share drivers pay fees five times more than city taxi drivers do. Baraka responded by calling out Uber drivers for not wanting to be regulated or paying their fair share.