It has become a Boston police department tradition. For the ninth year in a row, law enforcement officials from across the city played Santa for children. It’s called “Shop with a Cop.”

This was the ultimate Christmas shopping trip for 12-year-old Madison Collins of Boston. She was thrilled to meet Mayor Marty Walsh before she filled up her shopping cart at the Target store at South Bay. Collins received a $100 gift card, paid for with donations.

“I got my little sister some clothes and then I got clothes for me and some toys,” she explained.

Collins and more than 300 other Boston area children flooded the store, each paired with an officer. She was paired with Boston police detective Anthony Williams, a 20-year veteran of the department.

For Collins’ family, this year’s program was especially timely. Her grandmother, Robin Gibbons, who is taking care of her, said it has been a rough year.

“I was kind struggling this year for Christmas because I am not working right now,” Gibbons explained.

Boston Police started “Shop with a Cop” as a way to help families in need and to build relationships between kids and officers. It is modeled on programs started in other cities about two decades ago.

“I’m from the city. I grew up in the city so I find something like this to be a blessing for us and an opportunity to give back,” Williams explained. “Growing up, I didn’t have a chance for opportunities like this to meet police officers for who they really are. In this day and time, it’s really important to develop that type of communication and understanding.”

With communication, understanding, and an eagle-eye for gifts, Madison said he won the 12-year-old over.

Thanks to her shopping partner — Collins said she found exactly what she was looking for this year.

“He helped me find Family Feud the game, and I got everything I wanted,” she said.

At the end of the night, Williams picked up the tab for what the gift card didn’t cover.

Boston police find participants by giving a number of slots to area schools, community centers and programs. Sometimes, officers pick children who are already in the store, with their parents' permission.

Money for the gift cards comes from Target stores, the Police Athletic League, police organizations, several local colleges and other private donors.