TORONTO -- Uber has announced a carpooling service that will run in Toronto for the duration of the Pan Am Games.

The ride-hailing company says UberPOOL, which will launch Tuesday and run until July 26, will allow passengers to share the cost of the ride with others taking a similar route.

Uber spokeswoman Susie Heath says Toronto is the sixth city in the world with UberPOOL, joining the likes of New York City and San Francisco.

The company recently won a legal battle in an Ontario court against the City of Toronto, which sought a permanent injunction against Uber's operations.

The judge ruled there was no evidence the company is operating as a taxi broker or that it breached city bylaws, saying the city's definition of a brokerage was too broad.

Toronto and Ottawa city councils met recently with Uber and taxi companies to try to figure out a way forward.