Play video content @hilaryduff

Hilary Duff got in the face of a photographer whom she felt was invading her privacy by snapping pics of her kids during a soccer game -- but he didn't back down on video.

The 'Lizzie McGuire' actress posted the confrontation on Instagram Saturday, showing her walk up to a guy on the sideline of her one of her kids' soccer game and ask him who he's there with ... and what exactly he's doing taking pictures of the children.

It's pretty tense ... the man says he's not there with anyone but himself, and HD demands to know why -- if he isn't with anyone or isn't affiliated with anyone on the team -- he's out there taking pictures of 7-year-olds. His smug answer ... 'cause it's legal, lady.

The implication here is that this dude may be a paparazzi photog, and was only out to snap pics of Hilary and her children ... something she's dealt with before in similar fashion.

Play video content @hilaryduff

Something Hilary might wanna take into account the next time she encounters one of these photog hounds trying to get photos of her and/or her kids ... it actually ain't legal like the man claimed -- at least according to California law, where this appears to have happened.

In 2013, Gov. Brown signed SB 606 into law, which made the photographing of minors because of a parent's "employment" (AKA celebs) illegal if it falls into the area of harassment, annoyance, alarm, or torment without legitimate purpose ... punishable by up to a year in jail.