SAN FRANCISCO - Uber’s terrible, horrible, no good, very bad week is getting worse.

Accused on Sunday by a former engineer of having allowed widespread sexual harassment to persist at the ride-hailing company, a competitor is now accusing Uber of stealing its intellectual property.

The brewing showdown emerged late Thursday in a lawsuit filed in a San Francisco federal court by Waymo, a once-secretive self-driving company hatched by Google eight years ago.

Get Breaking News Delivered to Your Inbox

The 28-page complaint accuses Anthony Levandowski, a former top manager for Google’s self-driving car project, of stealing pivotal technology now propelling Uber’s effort to assemble a fleet of autonomous vehicles for its ride-hailing service.

The alleged chicanery occurred in late 2015, before Levandowski left to found a startup called Otto that is building big-rig trucks that navigate highways without a human behind the wheel. Uber bought Otto for $680 million last year, and Levandowski is now overseeing Uber’s effort to develop and dispatch cars driven by robots.

Uber and Levandowski didn’t immediately respond to requests for comment.

The dispute highlights the high stakes in the race to build self-driving cars that promise not only to revolutionize the way people get around but also the automobile industry. Waymo and Uber are two of the early leaders, while long-established car companies such as Ford, Toyota and General Motors are scrambling to catch up.

Waymo’s lawsuit also will escalate the tensions between Google and Uber, two one-time allies that are morphing into rivals. Google invested $258 million in Uber, but its mapping subsidiary Waze is now expanding a carpooling service that could lure riders away from Uber. The budding rivalry prompted a top Google executive, David Drummond, to resign from Uber’s board of directors six months ago.

Waymo now operates as a subsidiary of Google’s corporate parent, Alphabet Inc. (GOOGL), but its roots are in Google, where Levandowski worked for years.

The complaint cites evidence Levandowski loaded 14,000 confidential files on a laptop before leaving to Otto. The alleged theft included the designs for circuit boards needed for “LiDAR,” an array of sensors that enable self-driving cars to see what’s around them so they can safely navigate roads.

Waymo contends other former Google employees also stole trade secrets before leaving to join Otto. Without the alleged skullduggery, Waymo alleges that Levandowski and the other former Google employees wouldn’t have been able to build the Otto technology that generated the windfall from the Uber sale.

Although it has been around for less than a decade, Uber already has a reputation for testing legal boundaries.

The San Francisco company has tangled with authorities in California and around the world about how much of its drivers’ histories should be covered in background checks and whether those drivers should be treated as contractors ineligible for employee benefits. Late last year, Uber quickly suspended a test of its self-driving cars in San Francisco after regulators revoked the vehicles’ registrations for not having the proper permits.

Waymo is seeking a court order prohibiting Uber from relying on its technology in its self-driving vehicles as well as damages that could be tripled on some of the infringement claims if it prevails in court.

Uber is also in the spotlight after former employee Susan Fowler Rigetti wrote a blog post claiming Uber’s human resources department ignored her and other women employees’ complaints of sexual harassment. Uber has hired former U.S. Attorney General Eric Holder to investigate the allegations.

Earlier this month, Uber Travis Kalanick also resigned from President Donald Trump’s economic advisory council following criticism on social media about his participation on the White House panel of top business executives.