Joe Biden said Saturday that he regrets comments he made last month about his past work with segregationist senators—remarks that ignited scrutiny and criticism of his record on racial issues.

“Was I wrong a few weeks ago? Yes, I was, and I regret it,” the former vice president said Saturday at a speech in South Carolina.

He said it was a mistake to give the impression he was praising former Democratic Sens. James Eastland and Herman Talmadge—noted racists—while talking about the need for civility in politics.

“I’m sorry for any of the pain or misconception I may have caused anybody,” Biden said.

Biden’s references to Eastland and Talmadge brought criticism from his 2020 rivals that continued into the first Democratic debate, where Sen. Kamala Harris teed off on his opposition to federally mandated busing to desegregate schools.

Biden—who saw his lead in the polls shrink while Harris gained ground after the debate—said it was unfair to judge him on the basis of one gaffe.

As he defended his record on civil rights, he invoked former President Barack Obama, arguing his selection as vice president was proof enough that he stands on the right side of the issues.

“I was vetted by him and selected by him. I will take his judgment of my record, my character, and my ability to handle the job over anyone else’s,” Biden said.

While backtracking from his comments about Eastland and Talmadge, Biden did say that in the Senate, “to get things done, you have to work with people who were elected before you” and that “some of those people might be downright repugnant.”

He listed off his accomplishments in the Senate, while also explaining why he supported controversial legislation such as his support of the 1994 Crime Bill. He admitted the bill’s mistakes, but ultimately justified his support because he was able to help get things done in Congress.

“I’ve chosen to act,” he said of his career.

The candidate expressed annoyance that opponents are digging into his career on Capitol Hill instead of his eight years as Obama’s No.2. But even before his speech started, Harris’ campaign spokesman appeared to send the message that Biden should get used to it.