Obama made the remarks while on the campaign trail for New Jersey Gov. Phil Murphy in Newark on Saturday.

In his speech, Obama called out Republicans for opposing voting rights legislation and those who continued to mount baseless claims of widespread voter fraud in the 2020 election.

“You got to ask yourself though, why is it that Republicans don’t want people voting?” Obama said. “What are they so afraid of? If you’ve got better ideas, make your case.

“People flock to you if you’ve got good ideas. Make your case! Instead, they try to rig elections…. cause they know people don’t agree with their ideas. And when that doesn’t work, they start making up stuff, like the one about how they didn’t lose the last election.”

Obama then noted that he had lost a congressional election in Chicago. “I didn’t know I could just like after I got beat, I could just get up and say, ‘No, I didn’t get beat. No, no, no. The machines were broken,’” he joked.

Obama then took aim at Ciattarelli for claiming he didn’t know he was speaking at a rally in support of former President Donald Trump’s false claims that the election was stolen from him.

Ciattarelli acknowledged attending the Bedminster rally in November last year during a gubernatorial debate but has repeatedly claimed that he wasn’t aware of the event’s theme. He has also said he believes Joe Biden is the legitimate president.

Images used in a television ad from Murphy’s campaign show Ciattarelli standing in front of a banner saying “Stop the Steal” and crowds waving similar banners as well as a Confederate flag.

“When you’ve got a candidate who spoke at a ‘Stop the Steal’ rally, you can bet he’s not going to be a champion of democracy,” Obama said.

“Apparently Phil’s opponent says, well, he didn’t know it was a rally to overturn the results of the last election. He didn’t know it. Come on. When you’re standing in front of a sign that says ‘Stop the Steal’ and there’s a guy in the crowd waving a Confederate flag, you know this isn’t a neighborhood barbecue. You know it’s not a League of Women voters rally. Come on. Come on, man.”

Jerrel Harvey, a spokesperson for Murphy’s campaign, told Newsweek: “Assemblyman Jack Ciattarelli attended a ‘Stop the Steal’ rally to push the same dangerous conspiracies that Trump used to inflame extremists ahead of January 6.

“He then refused to acknowledge that President Biden was legitimately elected until weeks after the election. Republicans like Assemblyman Ciattarelli will do or say anything to pander to the far-right, even if that means undermining democracy.”

Ciattarelli’s campaign has been contacted for comment.

Update 10/24/21, 9:35 a.m. ET: This article was updated with comments from Phil Murphy’s campaign.