District attorney’s offices in New York City have generally supported the Police Department — or kept quiet about their reservations — during the escalating battle over the department’s stop-and-frisk program, under which hundreds of thousands of citizens are stopped every year, often for no reason.

But a hearing under way in Federal District Court in Manhattan is featuring an open and fiery dispute between the Police Department and an assistant district attorney from the Bronx, who has testified that her office began to have misgivings about the legality of some trespassing arrests as far back as five years ago.