Alex Wong/Getty Images
The former House speaker's comments came on Fox News when host Sean Hannity asked, "What does this tragedy, this evil attack tonight, mean for that conflict and debate?"
"Western civilization is in a war," Gingrich said. "We should frankly test every person here who is of a Muslim background, and if they believe in Sharia, they should be deported. Sharia is incompatible with Western civilization. Modern Muslims who have given up Sharia, glad to have them as citizens. Perfectly happy to have them next door."
He added: "Anybody who goes on a website favoring ISIS, or Al Qaeda, or other terrorist groups, that should be a felony, and they should go to jail. Any organization which hosts such a website should be engaged in a felony. It should be closed down immediately."
The First Amendment to the US Constitution protects against "an establishment of religion, prohibiting the free exercise thereof."
Gingrich, who was thought to be one of Donald Trump's top picks for vice president, said he was "sick and tired of being told that the wealthiest, most powerful civilization in history, all of Western civilization, is helpless in the face of a group of medieval barbarians."
"We're told to be reasonable, to be passive, to not judge," he said. "Well I just want to tell you tonight, everybody who watches this video, this is the fault of Western elites who lack the guts to do what is right, to do what is necessary, and to tell us the truth, and that starts with Barack Obama."
At the end of Gingrich's lengthy statement, Hannity replied: "That's a powerful statement. I agree wholeheartedly."
The attack in Nice, France, Thursday left at least 80 dead and more than 100 wounded.