Shares of banks and other financial institutions rose after robust bank earnings.

JPMorgan Chase, Goldman Sachs, Bank of America, Citigroup and Wells Fargo collectively earned more than $49 billion, a 39% jump from a year ago and above analyst estimates.

The quarter was "close to as good as it gets," with strong performance for equity and bond trading, investment banking, commercial banking and consumer lending, said Jamie Dimon, chief executive of JPMorgan.

Goldman Sachs' revenue growth was particularly pronounced after it led underwriting on the SpaceX initial public offering, which helped the bank more than double its fees from equity underwriting to nearly $1 billion.

Growth at Wells Fargo and Citi was not as strong as some investors had anticipated and shares of both banks fell.