Two Brooklyn men were arrested when they allegedly tried to steal a backpack from a man seated inside a Sunset Park Subway restaurant over the weekend, police said.

Two of the three suspects -- Luis Reynoso, 19, and Joshua Membrano, 23 -- were arrested after police canvassed the neighborhood with the 21-year-old victim. The third suspect is on the loose.

The trio first approached the victim at about 7:30 p.m. inside the Fourth Avenue restaurant, near 23rd Street, on Saturday night. They started slapping him several times while one of the suspects motioned toward a concealed gun, police said. One of the suspects then tried to take his backpack, but the victim held on and the suspects fled.

When they came back, the victim was on the phone with police and the trio apparently demanded to know who he was talking to. They started punching him again before running.

Officers found one alleged attacker near 23rd Street and Fifth Avenue.

Two other officers then spotted a second suspect riding a bike along Fifth Avenue, but as they tried to stop him, near 19th Street, he dropped the bike and started running, allegedly throwing his loaded .22 caliber gun onto the roof of the Saint Nicholas Ukrainian Church, police said. He was then caught and arrested.

The victim was taken to Maimonides Medical Center after suffering pain and swelling to his face, police said.