The police bomb-squad detective stood on West 27th Street in Chelsea on that warm Saturday night. A pressure cooker had been found on the sidewalk, with a cellphone beside it, the two connected by wires. A woman who had called 911 initially thought it was a child’s discarded science experiment. The detective knew it was likely an explosive device — another one had just exploded four blocks away.

Over his shoulder, more bad news. “There was a hotel bar, restaurant, across the street,” the detective, Jason Hallick, testified on Thursday. “I could see people in the windows.”

He and three other officers huddled. “We decided on a plan of attack,” Detective Hallick said.

His testimony, a firsthand account of disabling a bomb last year, was delivered in Federal District Court in Manhattan in the trial of Ahmad Khan Rahimi, the man accused of setting the device and another that exploded on West 23rd Street. The trial completed its first week of testimony on Thursday, and prosecutors said they expect to rest their case next week.