As Crown Prince Mohammed bin Salman of Saudi Arabia charmed Goldman Sachs bankers and Silicon Valley executives on an American tour this spring, some of his most trusted lieutenants were taking care of business in Washington.

In a low-key ceremony two blocks from the White House, Saudi officials signed an agreement with Booz Allen Hamilton, the American consulting company, to help train the kingdom’s growing ranks of cyberfighters.

The agreement would “open great horizons” by improving the skills of the kingdom’s cybersecurity experts, Saud al-Qahtani, a top adviser to the crown prince overseeing the deal, said in Saudi Arabia in a statement to the official press. It did not mention his continuing campaign to silence critics both inside the kingdom and online.

Mr. Qahtani was fired last month after Saudi officials linked him to the murder of the journalist Jamal Khashoggi, saying he had contributed to an aggressive environment that helped lead to the killing. But while Mr. Khashoggi’s death prompted investors from around the globe to distance themselves from the Saudi government, Booz Allen and its competitors McKinsey & Company and Boston Consulting Group have stayed close after playing critical roles in Prince Mohammed’s drive to consolidate power.