* Riyadh gives Canadian envoy 24 hours to leave

* Recalls Saudi ambassador to Ottawa

* Canada had urged activists' release (Adds Canadian Foreign Ministry statement, UAE reaction, decision to suspend educational exchange programmes)

By Aziz El Yaakoubi and David Ljunggren

RIYADH/OTTAWA, Aug 6 (Reuters) - Saudi Arabia froze new trade and investment with Canada and expelled the Canadian ambassador, in a stern gesture of retaliation after Ottawa urged it to free arrested civil society activists.

The sudden sharp response to criticism shows the limits of reforms by Saudi Arabia's 32-year-old Crown Prince Mohammed bin Salman, who runs its day-to-day government. He has launched a campaign of social and economic change, but has not eased the absolute monarchy's total ban on political activism.

In recent months Saudi Arabia has lifted a ban on women driving, but it has also arrested activists, including more than a dozen high profile campaigners for women's rights.

Riyadh recalled its own ambassador from Canada and gave the Canadian ambassador 24 hours to leave, a Saudi foreign ministry statement said late on Sunday. It retained "its rights to take further action", it added.

The announcement, carried on the official Saudi Press Agency caught diplomats in Riyadh off guard. Both the Saudi and Canadian ambassadors were away on leave when it was made.

It was not immediately clear what effect, if any, the ban on new trade would have on existing annual Saudi-Canadian trade of nearly $4 billion and on a $13 billion defence contract.

A spokeswoman for the Canadian Foreign Ministry said Canada was "seriously concerned" about Saudi Arabia's decision, but standing its ground on human rights comments.

"Canada will always stand up for the protection of human rights, very much including women's rights, and freedom of expression around the world," said spokeswoman Marie-Pier Baril.

On Friday, Canada had expressed concern over the arrests of activists in Saudi Arabia, including prominent women's rights campaigner Samar Badawi.

"We urge the Saudi authorities to immediately release them and all other peaceful human rights activists," Global Affairs Canada said on its Twitter feed.

Riyadh said that amounted to "a blatant interference in the Kingdom's domestic affairs, against basic international norms and all international protocols".

"It is quite unfortunate to see the phrase 'immediate release' in the Canadian statement, which is a reprehensible and unacceptable use of language between sovereign states."

The kingdom will suspend educational exchange programmes with Canada and move Saudi scholarship recipients to other countries, Saudi-owned Al Arabiya reported on Monday. Neighbours and allies Bahrain and the United Arab Emirates said they stood with Riyadh, although they did not announce similar measures.

LIMITS TO REFORM

Crown Prince Mohammed, as heir to the throne, is in line to become the first Saudi king from a new generation after a succession of six brothers dating to 1953. He has ambitions to diversify the economy from oil exports and ease some social restrictions. But his reforms include no changes that would liberalise a political system that allows no public dissent.

Amnesty International said the response to Canada showed that it was important Western countries not be intimidated into silence over Riyadh's treatment of dissenters.

"Instead of pursuing human rights reform, the government of Saudi Arabia has chosen to lash out with punitive measures in the face of criticism. States with significant influence in Saudi Arabia - such as the USA, UK and France - have now remained silent for far too long," said Samah Hadid, Amnesty International's Middle East Director of Campaigns.

Riyadh has a record of responding robustly to Western criticism under Mohammed bin Salman.

In May, German magazine Der Spiegel reported that the crown prince had suspended new government contracts to German firms. Riyadh had earlier recalled its ambassador from Germany for consultations over comments the German foreign minister made about a political crisis in Lebanon. It also recalled its ambassador from Stockholm and stopped issuing business visas to Swedes in 2015 following criticism of its human rights record.

"Saudi Arabia is shooting itself in the foot. If you want to open up your country to the world, you don't start expelling ambassadors and freezing trade with countries such as Canada," said Joost Hiltermann, regional programme director for the International Crisis Group.

"They want to impose and carefully control reforms, because they are deadly afraid of bottom-up change, for example via women activists. But this gets them in trouble with their Western partners."

Saudi-Canadian trade consists largely of Saudi exports of petrochemicals, plastics and other products. In 2014, the Canadian unit of U.S. weapons maker General Dynamics Corp won a contract worth up to $13 billion to build light-armoured vehicles for Saudi Arabia, in what Ottawa said was the largest advanced manufacturing export win in Canadian history. ($1 = 3.7503 riyals) (Reporting by Aziz El Yaakoubi in Riyadh; Nayera Abdullah in Cairo; Katie Paul in Dubai; Denny Thomas in Toronto; and David Ljunggren in Ottawa, Writing by Denny Thomas and Katie Paul Editing by William Maclean and Peter Graff)

Our Standards: The Thomson Reuters Trust Principles.