A toy gun-wielding teenager was shot in Philadelphia on Sunday night after allegedly attempting to rob a man who was carrying a loaded gun.

Police said the 16-year-old and another suspect approached a man and his girlfriend on the 2200 block of Emerald Street at about 11 p.m. on Sunday, according to FOX 29 in Philadelphia.

One of the suspects allegedly pressed a weapon into the man’s back before demanding his keys, wallet and other valuables.

Unbeknownst to the suspects, the man they were robbing was armed with a legal firearm, police said, and he opened fire on the two suspects, striking the 16-year-old in the leg.

ELON MUSK CALLS OUT CRIMINAL CHAOS IN BLUE CITY, SAYS IT REMINDS HIM OF ‘JOKER’ MOVIE

Philadelphia police vehicle

Philadelphia police responded to the scene of a shooting Sunday night after a teen suspect allegedly used a toy gun in an attempt to rob an armed man. (FOX29 Philadelphia WTXF)

A preliminary investigation found the weapon used by the teenager was a toy gun, which was recovered at the scene.

"Having been pressed into the victim's back, there would have been no way for them to know that," Philadelphia Police Inspector DF Pace told the station.

PERSON REPORTEDLY INJURED IN SHOOTING NEAR PHILADELPHIA CITY HALL JUST HOURS BEFORE PRESIDENTIAL DEBATE

Philadelphia skyline

A general view of the Philadelphia skyline (Tim Nwachukwu/Getty Images)

Fox News Digital has reached out to the Philadelphia Police Department for more information on the matter.

The station reported that the victim was not injured, though the teenager who was shot in the leg was taken to an area hospital for treatment while in police custody.

CLICK HERE TO GET THE FOX NEWS APP

Police are searching for the second suspect.