Parents vying for the perfect photo op of their diploma-receiving toddlers turned a kindergarten graduation ceremony at a Brooklyn public school into an all-out brawl Friday morning, witnesses said.

Up to six camera-toting parents posted up in a small space in the back of the auditorium at P.S./I.S. 178 in Crown Heights started shoving and yelling at each other over a photo opportunity around 10 a.m. as the young grads in light blue caps and gowns were handed their diplomas, witnesses said.

“They were just fighting trying to take pictures of their children,” said parent Estelle Smith, 41, who was there for her 6-year-old daughter, Estelle, when she saw a commotion break out from her fourth-row seat.

A school aide known as Mrs. Nelson who intervened and tried to break up the mayhem was even hit during the melee at the Dean Street school.

“I can’t believe it,” Nelson, who was not seriously injured, told The Post afterward. “All of this for a picture?”

“Mrs. Nelson was trying to stop the fighting and she wound up getting hit,” Smith said, adding that there was “a lot of yelling, pushing” when the altercation turned physical.

The mom said, “Parents were trying to get pictures of their kids being photogenic … Why would you start a brawl in front of the children?”

Smith said that luckily at the time of the fracas, the tots were occupied.

“The children were trying to get ready to receive their certificate,” she said.

Police were called to the school and the fighting parents were ultimately kicked out and the graduation finished as planned, witnesses said.

Before the ceremony started, school officials warned parents to keep the photo-taking to a minimum.