The Kingdom of Saudi Arabia executed a man by crucifixion in the holy city of Mecca on Wednesday amid trying to attack Canada on its human-rights record.

Saudi Arabia frequently uses capital punishment for crimes like homosexuality or anti-government activities, though crucifixions are rare.

It has lashed out at Canada, sometimes harshly, since Ottawa last week called for the release of jailed women's rights activists in the kingdom.

Saudi Arabia has restricted travel, medical access, and student scholarships to Canada while using its state-owned media to depict the country as unjust.

The Kingdom of Saudi Arabia executed a man by crucifixion in the holy city of Mecca on Wednesday amid waging a public-relations battle with Canada over human rights.

The man, Elias Abulkalaam Jamaleddeen, was accused of murder, theft, and attempted rape, according to Bloomberg.

Saudi Arabia, ruled by its interpretation of Islamic law, rarely carries out crucifixions, but capital punishment remains common.

Crimes in Saudi Arabia such as homosexuality and attending anti-government rallies have previously led to crucifixion sentences. Unlike the biblical crucifixions carried out by the Romans against Christians in antiquity, Saudi crucifixions usually involve displaying a beheaded corpse in public on a cross.

The execution came during a deepening dispute between the two countries sparked by Canada's criticism of Saudi Arabia's detention of activists.

Canada on Friday called for Saudi Arabia to release women's rights campaigners detained in the country, prompting a harsh response from the kingdom.

Saudi-owned media has blasted Canada for arresting a Holocaust denier and other citizens. TV pundits have brought up Canada's suicide rate in what appeared as a broadside against the country's way of living.

And Saudi media took a decidedly dark turn on Monday when it appeared to threaten Canada with a 9/11-style attack by tweeting a graphic with an image of an airliner flying toward Toronto's skyline.

The absolute monarchy ruling Saudi Arabia tightly controls the media broadcast within its borders, as well as its foreign-policy messaging.

In a statement, Saudi Arabia's Foreign Ministry described Canada's call to free the women's rights activists as "blatant interference in the Kingdom's domestic affairs."

The ministry went on to threaten vague retaliation against Ottawa.

"Any further step from the Canadian side in that direction will be considered as acknowledgment of our right to interfere in the Canadian Domestic affairs," it said.

Saudi Arabia has suspended new trade agreements with Canada and expelled Canada's ambassador. It stopped medical treatment programs of Saudis in Canada and said it has made arrangements to transfer those affected.

Saudi scholarship recipients at Canadian universities were ordered to other countries. Saudi Arabia's airline suspended flights to and from Canada, potentially complicating travel plans for Canada's Muslim population ahead of the annual Hajj pilgrimage to Mecca later this month.

Where are Canada's friends?

German Chancellor Angela Merkel, US President Donald Trump, Canadian Prime Minister Justin Trudeau, and French President Emmanuel Macron at the G7 summit. Leon Neal/Getty Images

But Canada has remained firm. Chrystia Freeland, the head of Canada's foreign-affairs ministry, whose tweet sparked the hostility, said that "Canada will continue to advocate for human rights and for the brave women and men who push for these fundamental rights around the world."

On Thursday, she tweeted of Samar Badawi, a recently detained women's rights activist who's the sister of Raif Badawi, an activist who remains 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."

But the UK and the US — two countries that maintain close ties with both Ottawa and Riyadh — have remained relatively silent.

The US State Department issued a vague statement calling for Saudi Arabia to respect due process and saying it would comment on the kingdom's human-rights record in an annual report on human rights around the world.

The UK, meanwhile, expressed "strong" support for human rights and said it "regularly" raises concerns with the kingdom, but it did not mention the Badawis.

Saudi Arabia, under the new leadership of young Mohammed bin Salman, has undertaken several reforms designed to fight radicalism and improve human rights and economic prospects for the country. It has granted women the right to drive, but legally they remain in the care of men.