Amazon.com Inc on Wednesday pressed a New York judge to dismiss a lawsuit by state Attorney General Letitia James claiming the online retailer failed to ensure worker safety at two New York City warehouses as COVID-19 infections surged.

James sued Amazon in February over its safety protocols for thousands of workers at a Staten Island fulfillment center and a Queens distribution center, and for allegedly retaliating against two employees who protested against the conditions.

But at a hearing, a lawyer for Seattle-based Amazon said the federal Occupational Safety and Health Administration had the expertise and authority to oversee workplace safety at private employers, preempting James’ state law claims.

“The court should defer to that agency, rather than wade into that quagmire,” the lawyer Jason Schwartz told Justice Nancy Bannon of the Manhattan Supreme Court.

Schwartz added that Amazon had cause to discipline the protesters Christian Smalls and Derrick Palmer, saying they ignored social distancing rules, while Smalls violated a paid quarantine to lead a March 2020 protest.

Smalls was fired, and Palmer received a written warning.

In response, Karen Cacace, the labor bureau chief in James’ office, said Amazon “put profits as their primary goal,” and needed a court-appointed safety monitor.

She also noted that COVID-19 cases are rising as the more contagious Delta variant spreads, including a “serious uptick” in Staten Island.

“This is not a problem that has disappeared,” Cacace said.

Schwartz countered that a monitor was no longer necessary after Governor Andrew Cuomo ended the state’s COVID-19 emergency.

Bannon admonished both sides she will not let the daily headlines govern her ruling.

“I don’t hear anyone saying the whole pandemic is over,” Bannon said. “The news is not great this week about that. Tune in next week and it might be something different.”

Amazon has separately asked a federal judge in Brooklyn for an injunction to stop James from suing.

In a July 9 filing there, James said Amazon had not shown irreparable harm.