WASHINGTON — President Trump’s stunning firing of the F.B.I. director, James B. Comey, injected another volatile ingredient into the partisanship already engulfing the capital and threatened to overwhelm Republican efforts to convert their government control into legislative success.

The decision to oust Mr. Comey also increased the prospect of another confirmation fight in the Senate, as Mr. Trump promised to move quickly to replace Mr. Comey, who had overseen the inquiry into Russian meddling in the election. And the White House’s handling of the dismissal — and apparent failure to anticipate the severe backlash it would generate — renewed questions about the competence of administration officials and their ability to navigate Washington.

After the House finally managed to pass a Republican health care proposal last week, divisive as it was, congressional Republicans suddenly found themselves trying to explain how Mr. Trump was within his rights in jettisoning Mr. Comey. Democrats quickly coalesced around a push for a special prosecutor to take control of the Russia inquiry, saying the leadership of the Justice Department could not be trusted with the job after the termination of the F.B.I. chief on what they considered spurious grounds.