Two teens have been arrested in the shooting of a 12-year-old girl during a basketball tournament in Far Rockaway on Saturday, police said.

The victim, who was not identified, was struck in the left thigh just before 4:45 p.m. on a basketball court near Beach 59th Street and Shore Front Parkway in what appeared to be a gang-related shooting, police said.

An 18-year-old man, who allegedly appeared to be aiming for a 14-year-old boy when he pointed his weapon at the crowd of about 150 people, then allegedly ran through a parking lot and jumped the fence, police said.

Police chased the alleged shooter, identified as Dwight Henderson. Cops found Henderson allegedly handing a loaded 9 mm handgun to 16-year-old Geena Hill.

The 12-year-old girl was taken to North Shore LIJ Hospital in stable condition, police said.

Henderson was charged with several offenses, including second-degree attempted murder and resisting arrest. Hill was charged with possessing a defaced weapon as well as a loaded firearm, police said.

Henderson and Hill could not be reached for comment Sunday. It could not be determined if either had retained an attorney.