WASHINGTON — The effort to pressure Ukraine for political help provoked a heated confrontation inside the White House last summer that so alarmed John R. Bolton, then the national security adviser, that he told an aide to alert White House lawyers, House investigators were told on Monday.

Mr. Bolton got into a tense exchange on July 10 with Gordon D. Sondland, the Trump donor turned ambassador to the European Union, who was working with Rudolph W. Giuliani, the president’s personal lawyer, to press Ukraine to investigate Democrats, according to three people who heard the testimony.

The aide, Fiona Hill, testified that Mr. Bolton told her to notify the chief lawyer for the National Security Council about a rogue effort by Mr. Sondland, Mr. Giuliani and Mick Mulvaney, the acting White House chief of staff, according to the people familiar with the testimony.

“I am not part of whatever drug deal Sondland and Mulvaney are cooking up,” Mr. Bolton, a Yale-trained lawyer, told Ms. Hill to tell White House lawyers, according to two people at the deposition. (Another person in the room initially said Mr. Bolton referred to Mr. Giuliani and Mr. Mulvaney, but two others said he cited Mr. Sondland.)