WASHINGTON — Judge Ketanji Brown Jackson emerged on Wednesday from two grueling days of testimony before the Senate Judiciary Committee having weathered escalating Republican attacks on her record but leaving Democrats confident that she would become the first Black woman on the Supreme Court.

Questioning of President Biden’s nominee by Republicans grew increasingly hostile as they stepped up their criticism of what they portrayed as a pattern of leniency in her sentencing of child sex abusers and tried to paint her as a liberal on issues of race, gender, guns and abortion rights.

Despite early pledges from Republican leaders that the process would be marked by decorum and respect, the hearings were a bruising affair for the Senate, no less bitter or partisan than their immediate predecessors.

Even Senator Ben Sasse, Republican of Nebraska, vented his exasperation at “the jackassery we see around here” of “people mugging” for the cameras.

But notwithstanding the grilling Judge Jackson endured, there was no indication that Republicans had succeeded in derailing a confirmation that could be approved along party lines as soon as early next month.

Reflecting on the historic nature of that moment as her testimony drew to a close, Senator Cory Booker, Democrat of New Jersey and the only Black member of the committee, reminded Judge Jackson — and the country — of the significance of her quest, eliciting tears from the nominee when he invoked Harriet Tubman’s struggles from slavery to freedom.

“You are my star. You are my harbinger of hope,” he told her. “This country is getting better and better.”

On the whole, however, the two-day marathon of questioning was a contentious and at times outlandish affair. Judge Jackson was asked about children’s books, the degree of her religious faith on a numerical scale and her definition of the word “woman.”

The hearing steadily deteriorated on Wednesday as Republican senators repeatedly assailed Judge Jackson about her sentencing decisions on specific child sex abuse cases after spending much of the day on Tuesday peppering her with similar questions. Demanding answers from Judge Jackson in heated tones and interrupting her repeatedly when she tried to answer, they infuriated Democrats on the panel, at one point prompting a shouting match between Senator Ted Cruz, Republican of Texas, and Senator Richard J. Durbin, Democrat of Illinois and the chairman of the committee.

In one particularly heated exchange, Senator Lindsey Graham, Republican of South Carolina, pressed Judge Jackson about why she had not been tougher on consumers of child sex abuse imagery, saying that his view was “put their ass in jail.”

Judge Jackson outlined how such cases had changed since Congress passed a law that enhanced sentences based on the number of images found in a defendant’s possession. At the time of the law, such images primarily came through the mail, and the number of images indicated the lengths to which a person had gone to obtain them.

But, she tried to explain over Mr. Graham’s repeated interruptions, in the internet age, huge stores of images can be acquired with a few clicks of a mouse.

“You can be doing this for 15 minutes, and all of a sudden you are looking at 30, 40, 50 years in prison,” she said. Mr. Graham interjected, saying, “Good — absolutely good.”

The flashes of temper from Mr. Graham were particularly striking coming from a senator who voted less than a year ago to confirm Judge Jackson to the U.S. Court of Appeals for the District of Columbia Circuit. His aggressive questioning of Judge Jackson this week suggested that he was unlikely to back her for the nation’s highest court.

It also drew an angry response from Senator Patrick J. Leahy of Vermont, a former Democratic chairman of the Judiciary Committee and the senior member of the Senate, who said he had not seen the level of disrespect shown to Judge Jackson in his 48 years in the chamber.

“You had a Republican member who went way over the time allotted to him, ignored the rules of the committee, badgered the nominee, would not even let her answer the questions,” Mr. Leahy said. “I’ve never seen anything like that.”

Republican questioning skittered over a variety of social issues that are animating conservative voters ahead of the midterm election season, including antiracism and critical race theory. Mr. Cruz picked up a line of questioning from Tuesday night on transgender athletes, demanding that Judge Jackson define what a woman is. The Republican National Committee stuck with its allegations that Judge Jackson was racially divisive.

“The conservative movement should be alarmed not only by her record as an activist judge, but by her willingness to advocate for the divisive anti-American concepts like critical race theory,” said Matt Schlapp, a close ally of former President Donald J. Trump’s and the chairman of the Conservative Political Action Conference.

In a notable development, Judge Jackson, a Harvard graduate who is completing a six-year term on the university’s Board of Overseers, said that if she were confirmed, she would recuse herself from a marquee case: a challenge to Harvard’s race-conscious admissions policies that the court will consider in its next term, which starts in October.

Senator Tom Cotton, Republican of Arkansas, pressed her broadly on criminal sentencing and all but accused her of lying when she said she did not recall one particular case.

“Your nomination,” Mr. Durbin told Judge Jackson, “turned out to be a testing ground for conspiracy theories and culture war theories.”

But the heart of the Republicans’ attack was child sex crimes, a fraught, deeply uncomfortable subject that speaks to all Americans but carries special weight with the conservative fringe, fed on a diet of false QAnon conspiracy theories that hold that a cabal of pedophiles rule Washington.

Republicans far beyond the Judiciary Committee were clearly aiming not just at animating their own voters but at possibly peeling away one or two Senate Democrats — most likely Senators Joe Manchin III of West Virginia or Kyrsten Sinema of Arizona — and imperiling Judge Jackson’s elevation to the Supreme Court.

“Can Joe Manchin explain to West Virginians why he’s supporting this pedophile apologist?” Donald Trump Jr., the former president’s son, demanded on Twitter.

To keep the heat on, Mr. Cruz pressed Judge Jackson for case-specific details on her sentencing of those charged with sexual abuse, pointing to one instance in which she gave a defendant two years in jail when the sentencing guideline was about seven years.

“I’m asking you to take the opportunity to explain to this committee and the American people why in 100 percent of the cases you have people with vile crimes, and you have language saying they are vile crimes, but then you sentence them to very, very low sentences,” Mr. Cruz said.

He was followed by Senator Josh Hawley, the Missouri Republican who originally raised the sentencing issue before the hearings. Mr. Hawley repeatedly demanded that Judge Jackson say whether she regretted giving a “slap on the wrist” to another offender, Wesley Hawkins, who Mr. Hawley said was arrested again after his release.

“What I regret,” she replied, “is that in a hearing about my qualifications to be a justice on the Supreme Court, we have spent a lot of time focusing on this small subset of my sentences.”

Judge Jackson said that she had handed down sentences, some longer than 25 and 30 years, in more than 100 cases. “I’ve said what I’m going to say about these cases,” she said at one point. “No one case can stand in for a judge’s entire record.”

Democrats also sought to rebut the claims that Judge Jackson’s sentencing history was extreme, noting that it fell in the mainstream of federal judges. Senator Chris Coons, Democrat of Delaware, called the Republican assault “an attempt to distract from your broad support, your deep record, your outstanding intellectual and legal credentials.”

Whether the line of attack will have any impact is unclear. Mr. Manchin was in Paris for an international energy conference and had no comment on the hearings. Ms. Sinema did not respond to a request for comment.

Three Republicans voted less than a year ago to elevate Judge Jackson to the appellate court, but Mr. Graham appeared disinclined to repeat his vote. Senator Susan Collins, Republican of Maine, said she was still studying the matter, and Senator Lisa Murkowski, Republican of Alaska, could not be reached for comment.

Another undecided Republican, Senator Mitt Romney of Utah, said he would be meeting with Judge Jackson after the hearings and would make his decision afterward.