At a congressional hearing on Tuesday, the leaders of Harvard, the University of Pennsylvania and the Massachusetts Institute of Technology gave carefully worded — and seemingly evasive — answers to the question of whether they would discipline students who called for the genocide of Jews. The intense criticism that followed led many to wonder: Who had prepared them for testimony?

It turns out that one of America’s best known white-shoe law firms, WilmerHale, was intricately involved.

Two of the school presidents, Claudine Gay of Harvard and Elizabeth Magill of Penn, prepared separately for the congressional testimony with teams from WilmerHale, according to two people familiar with the situation who asked not to be identified because the preparation process is confidential.

WilmerHale also had a meeting with M.I.T.’s president, Sally Kornbluth, one of the people said.

The firm, created by a merger in 2004 between Wilmer Cutler Pickering of Washington and Hale and Dorr of Boston, has offices across the United States, Europe and Asia. It is best known in the legal industry for defending clients facing government investigations and enforcement. Among its best-known clients have been the oil giant BP PLC, which the law firm represented during government investigations after an oil spill in the Gulf of Mexico, and President Richard Nixon, whom it represented in his fight with Congress over the Watergate tapes.

It also has an extensive practice working with universities.

Lawyers for WilmerHale sat in the front row at the hearing on Tuesday. They included Alyssa DaCunha, who leads the firm’s congressional investigations and crisis management practices, and Felicia Ellsworth, the vice chair of the firm’s litigation and controversy department.

Both Ms. DaCunha and Ms. Ellsworth were involved in preparing the presidents of Harvard and Penn for the hearings, one person familiar with the process said. The schools each independently hired WilmerHale, and the firm created separate teams to prepare each president. The firm already had ties with all three schools.