WASHINGTON — Robert S. Mueller III’s longtime right-hand aide will appear beside him to assist as he testifies before two House committees on Wednesday, and will be sworn in as a witness for one of the sessions, according to congressional officials familiar with the arrangement.

The unusual arrangement was agreed to at the 11th hour on Tuesday, as lawmakers on the House Judiciary and Intelligence Committees were undertaking their final preparations for what was expected to be an inflection point in the Democrats’ investigations of President Trump.

[Follow our live coverage of Mueller’s testimony before Congress.]

Mr. Mueller, the former special counsel, had been expected to appear alone during both hearings, but his team made a last-minute request in recent days that the aide, Aaron Zebley, be sworn in as a witness. The Judiciary Committee did not ultimately agree to that, but it said Mr. Zebley could sit beside Mr. Mueller to provide counsel as he navigates lawmakers’ questions. Late Tuesday, an Intelligence Committee official said that panel would allow the deputy to take an oath and theoretically answer questions himself from members of the panel.

The requests injected a taste of uncertainty on Capitol Hill on the eve of the long-anticipated hearings.