Asian stocks rose on Thursday, with energy shares leading the way as crude oil prices bolted higher after US President Donald Trump's decision to pull out of a nuclear deal with Iran.

Elsewhere in Asia, a stunning election upset in Malaysia by the opposition sent ringgit forwards sliding more than 2 percent in offshore trade and the cost to insure against a Malaysian debt default rose.

Moody's ratings agency said the country was now in uncharted territory after an alliance of opposition parties led by former prime minister Mahathir Mohamad shocked the ruling coalition.

"The surprise win by Mahathir's coalition party is likely to see an increase in policy uncertainty at least in the short term with market volatility likely to be higher," said Sian Fenner, lead Asian economist at Oxford Economics.

Energy shares soared as crude oil prices reached 3-1/2-year highs, with investors betting the US withdrawal from a nuclear agreement with Iran would increase tensions in the Middle East and curtail oil supply.

Rising oil prices in turn pushed up US Treasury yields by fanning inflation concerns. The 10-year Treasury note yield rose to a two-week high above the 3 percent threshold before pulling back a little to 2.996 percent.