STERLING, Va. — As a Republican congressman prepares to open hearings on the threat of homegrown Islamic terrorism, President Obama’s deputy national security adviser visited a mosque here on Sunday to reassure Muslims that “we will not stigmatize or demonize entire communities because of the actions of a few.”

The White House billed the speech by the adviser, Denis McDonough, as a chance for the administration to lay out its strategy for preventing violent extremism. But the timing was no accident; Mr. McDonough was in effect an emissary from the White House to pre-empt Representative Peter King of New York, the Homeland Security Committee chairman, who has promised a series of hearings beginning Thursday on the radicalization of American Muslims.

“In the United States of America, we don’t practice guilt by association,” Mr. McDonough told an interfaith but mostly Muslim audience of about 200 here at the All Dulles Area Muslim Society, known as the Adams Center. “And let’s remember that just as violence and extremism are not unique to any one faith, the responsibility to oppose ignorance and violence rests with us all.”

Mr. McDonough made no explicit mention of the hearings or Mr. King. But his speech came on a day when the back-and-forth over Mr. King’s plans crescendoed, from the airwaves of Washington’s Sunday morning talk shows to the streets of Manhattan to this northern Virginia suburb, an area packed with Muslim professionals, many of whom are extremely wary of Mr. King and his plans.