WASHINGTON — A polarized Senate Judiciary Committee advanced the nomination of William P. Barr to be President Trump’s second confirmed attorney general on Thursday, as Republicans and Democrats split over his views on executive authority and the special counsel’s ongoing Russia investigation.

Mr. Barr will now go before the full Republican-controlled Senate, where he is expected to be confirmed and sworn into office as soon as next week. If confirmed, he would promptly assume responsibility for the special counsel investigation led by Robert S. Mueller III into possible ties between Mr. Trump, his associates and Russia, and whether the president obstructed justice.

Mr. Barr will get at least one Democratic vote in the full Senate. Senator Doug Jones, Democrat of Alabama, announced his support on Thursday.

But the committee’s debate and subsequent 12-10 party-line vote to effectively endorse Mr. Barr to the full Senate revealed how fraught the politics around the Justice Department have become after two years of unrelenting attacks by Mr. Trump.