U.S. stocks rose to all-time highs on Friday as investors shook off a widely unexpected result to the general election in the United Kingdom.

The Dow Jones industrial average rose about 115 points to a record, with Goldman Sachs contributing the most gains.

The S&P 500 gained 0.5 percent to reach a record high, with financials leading advancers. Financials received a boost from higher bank stocks, as the SPDR S&P Bank ETF (KBE) advanced 2.7 percent. The ETF was also on track for its best week of the year.

The Nasdaq composite hit a record high at the open before trading 0.3 percent higher.

“Investors have been pretty bullish all year,” said Chris Zaccarelli, chief investment officer at Cornerstone Financial Partners. “All of the fundamentals are there for the market to go higher, but from time to time we become concerned with political uncertainty.”

Prime Minster Theresa May’s Conservative party lost its parliamentary majority in the process, coming up with 318 of 650 seats. Conservatives held a 17-seat majority before the contest. Some pollsters expected May’s party to retain the majority while others expected them to build on it. That said, no other party came out with a clear majority.

“The muted response from financial markets so far reflects their sense of déjà vu. After all, in the past 12 months they have also had to absorb the shocks of the EU referendum result and President Trump’s election,” said Lucy O’Carroll, chief economist at Aberdeen Asset Management.

“That said, we could see a fair amount of volatility in the coming days and weeks unless Westminster’s response to this surprise result is remarkably smooth, which is unlikely. History tells us that hung parliaments are not durable, let alone with Brexit looming large,” O’Carroll said.