By Joseph Menn and Dan Levine

SAN FRANCISCO (Reuters) - A pitched legal battle between ride-hailing rivals Uber and Lyft, involving accusations of hacking and corporate spying, ended with a settlement this week that did not require either company to pay money, according to sources familiar with the agreement.

The settlement coincided with news that Lyft was working with investment bank Qatalyst Partners to pursue strategic options, including a possible sale of the company. The settlement would remove a legal risk for potential partners, though it could not be learned whether the deal or timing was linked to a possible transaction.

Lyft said on Monday that it had settled a lawsuit against its former chief operating officer, Travis VanderZanden, whom Lyft had accused of breaking his confidentiality agreement when he went to work for Uber. That suit had been scheduled to go to trial in August in a California state court.

Uber, for its part, said in a court filing that it had withdrawn a subpoena in a separate lawsuit over a data breach. Uber had suspected the breach may be traced to Lyft's chief technology officer, Chris Lambert, though Lyft has said it had no evidence that its employees were involved.

Uber declined to comment on the terms of the settlement. A Lyft spokesman also declined to comment.

The sources said both Uber and Lyft agreed that allowing their top executives to continue in their jobs without restriction was more important than scoring a legal victory.

Lyft has been working with Qatalyst Partners for about a year, using the boutique advisory firm to look at acquisition offers, investments, fundraising and partnership deals, people familiar with the matter said.

It is common for companies to eliminate uncertainties such as legal risk ahead of a deal.

Settlement talks between VanderZanden and Lyft stalled soon after a mediation session in March, Lyft lawyer James Lynch said at an April court hearing. But momentum towards a deal resumed in recent weeks, said sources familiar with the situation.

DRIVER DATA HACKED

VanderZanden served as Lyft's chief operating officer until August 2014, when he expressed disagreement with the company's leadership, according to court filings. He eventually resigned and became vice president of international growth at Uber.

Lyft sued him in November 2014. In a sworn affidavit, VanderZanden said Lyft believed he had told Uber that Lambert, the Lyft CTO, had discovered a method to "hack into Uber's computer systems and gain access to Uber confidential information."

Uber revealed last year that as many as 50,000 of its drivers' names and their license numbers had been improperly downloaded, and filed a lawsuit in a San Francisco federal court in an attempt to unmask the hacker.

As part of its investigation, Uber determined that an Internet address potentially associated with the breach could be traced to Lambert. Lambert's attorney told Reuters Lambert "had nothing to do" with the breach.

Reuters reported last year that the Department of Justice was investigating the breach, though two sources said they had seen no activity on the case in recent weeks.

If the criminal probe continues, Uber would still be able to share information with the Justice Department, one source said.

(Reporting by Dan Levine and Joseph Menn; Additional reporting by Heather Somerville; Editing by Jonathan Weber and Tiffany Wu)