Sen. Jeff Sessions defended his civil rights and immigration record Tuesday in a Senate confirmation hearing that saw Donald Trump's attorney general pick fend off attacks from Democratic lawmakers and energetic demonstrators.

The Alabama Republican, facing criticism for past accusations of racially charged comments that helped to cost him a federal judgeship, pledged to the Senate Judiciary Committee that he would uphold protections for African-Americans. Sessions was interrupted by protesters multiple times, with one protester shouting, "No Trump, no KKK, no fascist USA!"

Sessions also spoke on other heated issues, including immigration, policing, terrorism and the use of waterboarding, which he said was "absolutely improper and illegal."

Democrats and civil rights groups have slammed Sessions for his past statements and record, and in an unprecedented move, Sen. Cory Booker, D-N.J., will testify against his fellow senator at the two-day hearing, along with civil rights icon Rep. John Lewis, D-Ga.

Booker's office said that the Senate historian has been unable to find any previous instance of a sitting senator testifying against a fellow sitting senator nominated for a Cabinet position, according to NBC News.

The 70-year-old Sessions, an immigration hard-liner who previously served as Alabama's attorney general and U.S. attorney in Alabama, said he understands the horrible effect of "systemic discrimination" against African-Americans.

He promised to crack down on the flow of illegal drugs and gun crimes. He also echoed Trump in vowing to use "all lawful means" to respond to terrorist threats.

"I know the threat of terrorism. I deeply understand the history of civil rights in our country and the horrendous impact that relentless and systemic discrimination and the denial of voting rights has had on our African-American brothers and sisters. I have witnessed it," Sessions said. "We must continue to move forward and never back. I understand the demands for justice and fairness made by our LGBT community. I will ensure that the statutes protecting their rights and their safety are fully enforced. I understand the lifelong scars born by women who are victims of assault and abuse."

Despite the criticism, Sessions has many supporters in the Republican-controlled Senate and will likely get confirmed even if he leaves the process bruised.

In introducing Sessions, Sen. Richard Shelby, R-Ala., told his colleagues that Sessions has been attacked with "baseless and tired" allegations. Sen. Susan Collins, R-Maine, also said he has shown himself to be a "dedicated public servant."

He received backing from other notable Republicans on the committee including Sen. Lindsey Graham, R-S.C., and Sen. Ted Cruz, R-Tex., who said Sessions would be a "superb attorney general."

Critics have seized on that case, as well as his record on voting rights, as evidence that he may seek to stifle ballot access for minorities. Sessions contended that "the caricature of me in 1986 was not correct."

He also disavowed support for the Ku Klux Klan after his former colleagues testified in the 1980s that he joked he thought the group was "OK" until he learned that they smoked marijuana.

"I abhor the Klan and its hateful ideology," he said, shortly after a protester in a Ku Klux Klan outfit was removed from the hearing.

Sessions and allies like Cruz repeatedly asserted that Sessions had a key role in prosecuting a lynching by the KKK in Alabama.

Sessions also contended that he would not let personal views cloud his enforcement of the law. He said he disagreed with Supreme Court rulings that protect women's right to abortions and legalized gay marriage nationwide, but stressed that they were the law of the land and he would follow them.

He was also asked more than once how his Justice Department would handle the Obama administration executive order that allows undocumented immigrants who entered the country as children to get deferred action from deportation. Sessions, who previously opposed recent bipartisan immigration reform efforts, said he would "follow the laws passed by Congress."

While he encouraged Congress to pass immigration reform, he did not say how he would handle the undocumented children affected by Obama's action if the Trump administration revokes the order. When pressed again by Sen. Dick Durbin, D-Ill., he did not specifically say what would happen to the people shielded by the order if it is reversed.

Sessions said that lawmakers need to "enter into a dialogue about how to compassionately treat people who've been here a long time."

He also addressed concerns about Trump's late 2015 call for "a total and complete shutdown of Muslims entering the United States until our country's representatives can figure out what is going on." Trump and his aides have since tweaked it to say they will carry out "extreme vetting" from areas with a history of terrorism, though the Muslim ban proposal still sits on Trump's campaign website.

"I believe the president-elect has subsequently said that he belives the focus should be on people coming from nations with a history of terrorism ... and he supports strong vetting. ... I do not believe that Muslims as a group should be denied access to the United States," Sessions said.

Sessions also touched on waterboarding, a banned torture practice that Trump pledged to bring back. He argued that the law has made waterboarding "absolutely improper and illegal."

Sessions also promised to remove himself from potential investigations involving Hillary Clinton due to his past statements that "could place my objectivity in question."