WASHINGTON — William P. Barr, President Trump’s nominee for attorney general, promised on Monday that he would allow the special counsel to continue his investigation, seeking to allay Democrats’ fears that he might shut down the inquiry.

“It is in the best interest of everyone — the president, Congress, and, most importantly, the American people — that this matter be resolved by allowing the special counsel to complete his work,” Mr. Barr said in written testimony that he plans to deliver on Tuesday at the start of his two-day confirmation hearing before the Senate Judiciary Committee.

“The country needs a credible resolution of these issues,” he added. “If confirmed, I will not permit partisan politics, personal interests, or any other improper consideration to interfere with this or any other investigation.”

But Mr. Barr’s written statement also included a subtle caveat, limiting his assurances about the investigation to issues under his control: “I can assure you that, where judgments are to be made by me, I will make those judgments based solely on the law and will let no personal, political, or other improper interests influence my decision,” he wrote.