Kansas Secretary of State Kris Kobach, a Republican candidate for governor, poses with his controversial Jeep. (Kobach/Facebook)

Over the weekend, residents of Shawnee, Kan., gathered for the annual parade celebrating their city’s heritage.

People in lawn chairs peppered the sidewalks. Children sat on the curb, their eyes glued to the colorful floats and decorated cars inching down the street. A giant American flag suspended over the parade route flapped in the breeze.

Then an eye-catching vehicle rolled past the crowd. Reactions were mixed.

It was a Jeep painted like an American flag with a replica of what appeared to be a .50-caliber machine gun attached to the back, according to the Kansas City Star. Riding in it was Kansas Secretary of State and Republican gubernatorial candidate Kris Kobach, grinning and waving to onlookers.

“Had a blast riding in the Old Shawnee Days Parade in this souped up jeep with a replica gun,” Kobach tweeted after the parade. “Those who want to restrict the right to keep and bear arms are deeply misguided. The only thing that stops a bad guy with a gun is a good guy with a gun.”

But Kobach’s parade entry did not sit well with some attendees and sparked backlash on social media from people critical of the politician for displaying the gun at a family-oriented event where children were present.

“It was pretty shocking,” parade attendee Johnny Lewis told the Kansas City Star. “There were audible gasps from the folks we were sitting by.”

Lewis also took to Twitter to express his concerns. He wrote that his 6-year-old daughter, who was present at the parade, “worries constantly” about school shootings and “endures intruder training at school in fear.”

He added that the “very real looking” gun “with visible ammunition rounds hanging from it” was pointed at the crowd.

“My child didn’t need that today,” Lewis’s tweet went on to say. “Don’t care what your position is on second amendment that is completely unnecessary.”

Others called Kobach “clueless” and “socially tone deaf.”

“Children are scared to go to school and you cram this scene in their faces,” one user wrote. “I will do everything in my power to make sure you never set foot in the Governor’s office.”

Even some supporters of gun rights spoke out against Kobach’s actions.

On Facebook, one person commented, “I’m a lifelong conservative and strong believer in the second amendment, and I found your float extremely tacky and inappropriate.”

Another said he had planned to “defend Kobach,” but after seeing the Jeep, he changed his mind.

“If you wanted to show support for the 2nd Amendment, why didn’t you just carry a pistol on your hip?” the commenter wrote. “Why the big gun. Those ARE man killers. Replica or not, that was a dumb move. I’ve always liked Kobach, and I hope he makes better moves than this in the future.”

Some also pointed out that machine guns, similar to the replica Kobach used, are not protected by the Second Amendment.

After the parade, the City of Shawnee and the event’s organizers released a statement Saturday apologizing for the “concern and frustration” caused by Kobach’s actions.

“In no way does this or any parade entry or float directly reflect the views and values of the City, the Old Shawnee Days Board or the Old Shawnee Days Society,” the statement said. “Please know that the safety of our residents is always our highest priority and we apologize if this made anyone feel unsafe or unsettled.”

But in an interview with KMBC, Kobach insisted that “99 percent” of the crowd reacted “very positively” and noted that people were “taking pictures of the Jeep, giving me thumbs-ups.”

“Thank you for standing up,” one Facebook commenter said. “Sad we live next door to neighbors that have forgotten so much about history. Keep up the good fight.”

Another Facebook user called Kobach a “good man.”

“Guns were carried and displayed in every parade I’ve ever been to,” the comment said. “Proudly by the patriots who made our country great!”

On Sunday evening, Kobach defended his actions, posting a photo of himself next to the Jeep to Facebook and Twitter.

Along with the photo, Kobach wrote, “The outrage over the replica gun on the back of a patriotic jeep is the left trying to attack guns and your #2A rights. I will not back down in the face of a snowflake meltdown and outrage culture.”

Kobach told KMBC he thought the Jeep looked cool and that it symbolized the U.S. military, especially having the military gun mounted on it.

“I think it’s kind of amusing that snowflakes today think that people will be afraid at the sight of a gun,” he said.

More from Morning Mix:

Best friends and master climbers fall to their deaths while scaling Yosemite’s El Capitan

A car crashed into a Little League game. The ‘brave’ man who died saving kids had a dark secret.

‘Don’t let anything stop you’: Jimmy Fallon surprises Marjory Stoneman Douglas seniors at graduation