While President Trump’s travel ban threw American airports into chaos last weekend, Bob Ferguson, the attorney general of Washington State, was biding his time on an airplane.

On his way home from a conference of Democratic attorneys general in Florida, Mr. Ferguson landed a week ago in the center of a political and legal firestorm. Seattle-Tacoma International Airport was in disarray, with protests massing. Gov. Jay Inslee, a fellow Democrat, had sent word to the attorney general’s staff that he wanted to mount a battering-ram attack on the president’s decree.

Within two days, Mr. Ferguson had become a leading combatant in a battle with the president of the United States, filing a dramatic challenge to Mr. Trump’s travel ban that yielded a ruling from a federal judge on Friday freezing the order’s implementation.

A genial 51-year-old with an earnest demeanor, Mr. Ferguson cuts an unlikely figure as an antagonist for the most pugilistic president in modern times. He is seen in the state less as a chest-thumping showman than as a former member of the King County Council with a wonky sensibility and an eager manner.