It started with a mystifying missed opportunity on race. It ended with a piercing attack on gender.

Hillary Clinton’s performance in the first presidential debate on Monday veered from uncertain and tentative to firm and, ultimately, scorching.

No amount of practice, it seemed, could fully prepare her — or perhaps anyone — for Donald J. Trump’s hurricane of factual distortion, taunting interruptions and blustery generalities.

Mrs. Clinton seemed to slowly but steadily learn how to confront and subdue Mr. Trump on the fly, as tens of millions of Americans watched.

No moment seemed to better encapsulate her early misfires than an improbable and audacious line of attack from Mr. Trump, who has openly lied about President Obama’s place of birth and brazenly told black Americans that their communities, schools and job opportunities are uniformly awful.