The battle between Uber and Lyft is heating up, both on and off Big Apple streets.

Three months after Lyft opened its first permanent office in the city, Uber has doubled down on its Gotham operation, signing a lease for its second Manhattan headquarters — a 35,000-square-foot space at 38th Street and Broadway.

The office will primarily house its burgeoning New York engineering team, the company said.

Over the past two years, the number of Uber engineers in the city has grown to more than 150.

The company already occupies a 54,000-square-foot space in Chelsea with views of the Hudson River.

The San Francisco-based ride-hailing giant is aiming to double the size of that team to more than 300 before 2020, it said.

“New York City has become the tech hub of the East Coast and we are excited to expand our engineering footprint here,” Uber director of engineering Marc Donner told The Post. “With this new space, we plan to grow our engineering office and attract the top talent in the city.”

Uber, which dominated the headlines in recent weeks due to its high-profile court battle with Google-owned Waymo over trade secrets, has had a presence in New York City since 2011.

On Friday, it settled the $2 billion suit Waymo filed against it. Under the settlement, Waymo will get a $245 million stake in Uber.

In addition to Uber’s Chelsea headquarters and soon-to-come Midtown office, the company has three Greenlight Hubs for drivers — in Long Island City, the Bronx and Brooklyn.