Former Sen. Rick Santorum (R-PA) on Thursday insisted that he never compared the Supreme Court ruling legalizing same-sex marriage to the decision that upheld slavery.

During an event at the National Press Club in Washington, D.C., Santorum was asked about the comparison to the Dred Scott ruling and how he would address the court’s decision if elected President.

“I didn’t compare the recent decision of the court with Dred Scott. Justice Roberts compared the two. I was simply quoting Justice Roberts’ opinion, where he compared — he said the legal basis that undergirded Dred Scott is the same legal basis that is undergirding this decision,” Santorum said in response. “They both had, quote, in his words, ‘no constitutional basis’ for this decision.”

Santorum added that the Supreme Court decision on gay marriage was “not a work of legal scholarship.”

“It is simply, in my opinion, the rambling of someone who wanted to get a decision and came up with all sorts of interesting ideas, none of which are based in the Constitution,” he said.

But a review of Santorum’s comments on the matter shows he has compared the same-sex marriage ruling to the Dred Scott decision without mentioning Roberts.

Santorum made the comparison in a statement following the court’s ruling in June.

“The Court is one of three co-equal branches of government, and just as they have in cases from Dred Scott to Plessy, the Court has an imperfect track record,” he said.

But earlier this month during the first Republican presidential debate, Santorum did mention Roberts while comparing the rulings to each other.

“It is not anymore than Dred Scott was settled law to Abraham Lincoln who in his first inaugural address said it won’t stand. And they went ahead and passed laws in direct contravention to a rogue Supreme Court,” Santorum said. “This is a rogue Supreme Court decision, just like Justice Roberts said. There is no constitutional basis for the Supreme Court’s decision.”

Watch Santorum’s comment at the National Press Club below: