Surveillance video played in court Tuesday showed Milan Loncar walking his dog in his Brewerytown neighborhood on a January evening when two men boxed him in — one with a gun pointed at his chest, the other behind him. They rifled through his pockets. Then the gunman shot him in the chest.

The shooter and his accomplice ran away as Loncar, 25, stood still for a few seconds, appeared to try to use his phone, then collapsed to the sidewalk.

He was still clutching the leash of his dog, Roo, a dachshund-Chihuahua mix, when police responded a few minutes later, finding Loncar bleeding at 31st and Jefferson Streets. Officers rushed him to Temple University Hospital, where he was pronounced dead shortly afterward.

On Tuesday, the alleged gunman, Josephus Davis, 20, who lived a few blocks from the shooting, sat in a city courtroom accused of murder. Seven police witnesses testified about surveillance video, the distinctive clothing Davis wore the day of the shooting that was captured in the footage, alleged gunshot residue found on his jacket, and his arrest later that night in an unrelated carjacking.

Municipal Court Judge James DeLeon held Davis for trial on all charges, including murder, robbery, conspiracy, and gun offenses. He dismissed the carjacking charges, citing a lack of evidence.

Loncar’s mother, sister, and girlfriend were in the courtroom.

Homicide Detective Thorsten Lucke, who put together a compilation of surveillance videos from businesses and residences, described how after the shooting, which occurred just before 7 p.m., the gunman and his accomplice ran south, crossed through parking lots, jumped over a fence, then were seen walking on Master Street.

They turned onto the 1400 block of North Hollywood Street, where Davis lived. Shortly afterward, they were seen getting into the backseat of a stolen Ford Focus. About 8:30 that night, the Ford was spotted in Kensington, on Indiana Avenue near B Street. Highway Patrol Officer James Boone testified that he saw three men get out of the car, including Davis, who was wearing a jacket, a “shiny belt,” and partly white footwear.

During the hearing, Assistant District Attorney Joanne Pescatore displayed the clothing she said Davis wore that night. It matched the officer’s description. She said gunshot residue was found on his jacket.

After the hearing, Davis’ attorney, Doug Dolfman, called the shooting “tragic” and said he was still investigating the case.

Davis’ accomplice in the robbery and murder remains at large, Pescatore said. Loncar’s assailants, she said, found nothing in his pockets.