He left financial markets rattled, Congress blindsided, his own staff baffled and historians scratching their heads.