Saudi Arabia said on Sunday that it is ordering Canada's ambassador to leave the country and freezing all new trade and investment transactions with Canada in a spat over human rights.

"We consider the Canadian ambassador to the Kingdom of Saudi Arabia persona non grata and order him to leave within the next 24 hours," Saudi Arabia's Foreign Ministry said on Twitter.

<a href="https://twitter.com/hashtag/Statement?src=hash&ref_src=twsrc%5Etfw">#Statement</a> | KSA through its history has not and will not accept any form of interfering in the internal affairs of the Kingdom. The KSA considers the Canadian position an attack on the KSA and requires a firm stance to deter who attempts to undermine the sovereignty of the KSA. —@KSAmofaEN This is quoted by the Saudi statement...which says the people involved were arrested on charges of “committing crimes that should be stopped” and that their rights were “assured” in the process <a href="https://t.co/cgVp6QTiZD">https://t.co/cgVp6QTiZD</a> —@NahlahAyed

The ministry added that Saudi Arabia is recalling its ambassador to Canada. Both the Saudi and Canadian ambassadors were away on leave at the time of the announcement.

The dispute appears to be over a tweet on Friday from Global Affairs Canada.

"Canada is gravely concerned about additional arrests of civil society and women's rights activists in Saudi Arabia, including Samar Badawi. We urge the Saudi authorities to immediately release them and all other peaceful human rights activists," the tweet said.

'Unfortunate, reprehensible, and unacceptable'

The Saudi Foreign Ministry called the use of "immediately release" in Canada's tweet "unfortunate, reprehensible, and unacceptable in relations between states."

It dismissed Canada's characterization of the activists as "an incorrect claim" and said Canada's attitude was "surprising."

<a href="https://twitter.com/hashtag/Statement?src=hash&ref_src=twsrc%5Etfw">#Statement</a> | The Canadian position is an overt and blatant interference in the internal affairs of the Kingdom of <a href="https://twitter.com/hashtag/SaudiArabia?src=hash&ref_src=twsrc%5Etfw">#SaudiArabia</a> and is in contravention of the most basic international norms and all the charters governing relations between States. —@KSAmofaEN

"Any other attempt to interfere with our internal affairs from Canada, means that we are allowed to interfere in Canada's internal affairs," it said.

Saudi state television later reported that the Education Ministry was coming up with an "urgent plan" to move thousands of Saudi scholarship students out of Canadian schools to take classes in other countries.

The sudden and unexpected dispute bore the hallmarks of Crown Prince Mohammed bin Salman, Saudi Arabia's 32-year-old future leader, whose recent foreign policy exploits include the war in Yemen, the boycott of Qatar and Lebanese Prime Minister Saad Hariri's surprise resignation broadcast during a visit to the kingdom. Hariri later rescinded the resignation, widely believed to be orchestrated by Riyadh, and returned to Beirut.

'Canada will always stand up for ... human rights'

A spokesperson for Foreign Affairs Minister Chrystia Freeland issued a brief response to the Saudi complaint on Sunday evening.

"We are seriously concerned by these media reports and are seeking greater clarity on the recent statement from the Kingdom of Saudi Arabia," said Marie-Pier Baril.

"Canada will always stand up for the protection of human rights, very much including women's rights, and freedom of expression around the world. Our government will never hesitate to promote these values and believes that this dialogue is critical to international diplomacy."

Very alarmed to learn that Samar Badawi, Raif Badawi’s sister, has been imprisoned in Saudi Arabia. Canada stands together with the Badawi family in this difficult time, and we continue to strongly call for the release of both Raif and Samar Badawi. —@cafreeland

Saudi Arabia said it is also freezing all new trade and investment transactions with Canada and "reserves its right to take further action." Saudi Arabia is one of Canada's largest export markets in the region, and some 10 per cent of Canadian crude oil imports come from Saudi Arabia.

It said it will not accept any form of interference in its internal affairs and considers the Canadian position "an attack" requiring a firm stance to deter "attempts to undermine the sovereignty" of Saudi Arabia.

In neighbouring United Arab Emirates, Minister of State for Foreign Affairs Anwar Gargash said Monday on Twitter that his country stands with Saudi Arabia "in defending its sovereignty." Bahrain's foreign minister made similar comments in support of Riyadh.

Crackdown on human rights

Amnesty International has said Badawi, the sister of jailed blogger Raif Badawi, was recently detained along with Nassima al-Sada, another prominent female activist.

The human rights group's Middle East research director described the arrests as part of a larger crackdown on human rights in Saudi Arabia.

Jackie Hansen, a gender rights campaigner for Amnesty International Canada, said last Thursday that the circumstances of the arrests were still unclear and there was no news of any charges.

Badawi's brother was arrested in Saudi Arabia in 2012 and later sentenced to 1,000 lashes and 10 years in jail for criticizing clerics.

50 lashes

He received 50 lashes in January 2015 during a public flogging but is not believed to have received any further corporal punishment since then.

His wife,​ Ensaf Haidar, and three children live in Quebec and became Canadian citizens last month.

Samar Badawi, centre, is seen with Hillary Clinton and Michelle Obama in 2012. (Gary Cameron/Reuters)

Freeland said on social media last Thursday that she was "alarmed" to hear of Samar Badawi's arrest.

"Canada stands together with the Badawi family in this difficult time, and we continue to strongly call for the release of both Raif and Samar Badawi," she wrote on Twitter.

Germany recently targeted

​Bessma Momani, a political science professor at the University of Waterloo, believes the apparent diplomatic moves by Riyadh were about more than the Badawi case.

"I think one has to stand back and see that there's been a lot of heat on Saudi Arabia, particularly its treatment of civil society actors and and human rights activities," she said. "I think Canada is literally made to be an example."

We’ve seen a lot of support for Saudi dissidents in the UK, Canada, the US Congress, & others. But Canada is easier to cut ties with than the rest. There isn’t a strong bilateral trade relationship & poking Trudeau government likely resonates with Saudi’s hawkish regional allies. —@b_momani

Saudi Arabia ended in June its long practice of not allowing women to drive automobiles in the Sunni kingdom. However, supporters of women's rights were arrested just weeks before the ban was lifted, signalling that only King Salman and his powerful son, Crown Prince Mohammed bin Salman, will decide the pace of change.

Saudi women still need permission from male guardians to travel abroad or marry.

The Embassy of the Kingdom of Saudi Arabia is shown in Ottawa on Sunday. Saudi Arabia says it is ordering Canada's ambassador to leave the country. (David Kawai/Canadian Press)

Germany similarly has found itself targeted by the kingdom in recent months over comments by its officials on the Saudi-led war in Yemen.

It isn't immediately clear what new business could be affected between the two countries. Bilateral trade reached $3.9 billion Cdn in 2016, with tanks and fighting vehicles among the top Canadian exports to the kingdom, according to government statistics.

Saudi Arabia in recent years has expelled Iran's ambassador over attacks on its diplomatic posts following its 2016 execution of a prominent Shia cleric.

With files from CBC News, Reuters and The Associated Press