HAVERHILL, Massachusetts (WHDH) – A 38-year-old Massachusetts man was arrested after he was caught on camera following a little girl and taking inappropriate pictures of her with his cell phone.

His name was not released. Police said he was captured by 20 surveillance cameras in a Haverhill supermarket.

The surveillance footage shows him going right up to the mother and daughter and when the mom turned to grab an item off the shelf, he used his camera phone to take a picture up the girl’s skirt. She is 7-years-old.

“He followed them for 26 minutes. He had an intent. This is what he wanted to do and he did it,” said Lt. Robert Pistone of the Haverhill Police Department.

For those 26 minutes, he was caught on camera stalking the child up and down the aisles.

“It appears he’s getting up the courage,” said Pistone.

Right after the photo was taken, the mother’s instinct kicked in. Police said she asked the man if he touched her daughter.

“He said, I’m sorry. You’ll see he then walked out of the store,” said Pistone.

The man is facing three charges, including indecent assault and battery. Police said they are also executing a search warrant at his home in Haverhill. He will face a judge Thursday.