Image copyright Getty Images Image caption Burning offerings to pay respects to deceased ancestors is an important ritual in Chinese culture

Police in north-west China have charged a man with murdering two women with mental disabilities, alleging that he wanted to sell their corpses to be used in so-called "ghost weddings".

It has put a spotlight on the ancient shadowy ritual, still practised in certain parts of China, which aims to provide spouses for people who die unmarried.

According to police in Shaanxi province, the murder case dates back to April, when three men were detained after the body of a woman was found in their vehicle by traffic police.

Their investigation led them to uncover a grisly sequence of events in which the man, named only as Ma, allegedly promised the women he would find them grooms but instead killed them so he could sell their corpses.

What is a ghost wedding?

Believers in the custom, practised for some 3,000 years, say it ensures the unmarried dead are not alone in the afterlife.

Originally, the weddings were strictly for the dead - a ritual conducted by the living to wed two single deceased people - but in recent times some have involved one living person being married to a corpse.

In ghost marriages between two dead people, the "bride's" family demands a bride price and there is even a dowry, which includes jewellery, servants and a mansion - but all in the form of paper tributes.

Factors like age and family background are as essential as they are in more traditional weddings, so families hire feng shui masters to work as a match-maker.

The wedding ceremony will typically involve the funeral plaque of the bride and the groom and a banquet. The most important part is digging up the bones of the bride and putting them inside the groom's grave.

Is there a darker side to this tradition?

Image copyright Getty Images Image caption For years there have been reports of grave robberies to meet demand for the remains of women as ghost brides

For years there has been evidence of this ritual mutating in certain parts of China. There have been cases where a living person has been "married" to a corpse in a secret ritual, but more alarmingly reports of grave robbery and even murder have also surfaced.

In 2015, it was reported that 14 female corpses were stolen in one village in Shanxi province. Villagers said tomb-raiders stole the bodies to make money.

According to Huang Jingchun, the head of the Chinese department at Shanghai University who carried out a field study on ghost weddings in Shanxi between 2008 and 2010, the price of a corpse or the bones of a young woman has risen sharply.

At the time of his research such remains would fetch around 30,000 to 50,000 yuan (£3,400 to £5,700; $4,500 to $7.500). He estimates the price these days could be up to 100,000 yuan. The sale of corpses was outlawed in 2006 but that hasn't stopped grave robbers.

A man arrested in Liangcheng County, Inner Mongolia last year told police officers that he murdered a woman so that he could make money by selling her body to a family looking for a ghost bride.

Why is this happening?

The reasons vary from place to place. In some districts of China, such as Shanxi where the latest murders are alleged, there are large numbers of young, unmarried men working in coal mining, where fatalities are high.

Image copyright Szeto Fat-ching Image caption Paper versions of all the comforts of life are offered to the deceased

The ghost wedding serves as a form of emotional compensation for bereaved relatives, as finding a dead bride is something they can do for a son who died young while working to support the family.

But sex ratios are also significant. The 2014 census results show that about 115.9 boys were born for every 100 girls.

But Dr Huang believes there are also more fundamental cultural reasons.

Many Chinese people believe misfortune will be brought upon them if the dead's wishes have not been fulfilled. Hosting a ghost wedding is a means to pacify the dead.

"The basic ideology behind ghost weddings is that the deceased continue their lives in the afterlife," Dr Huang said. "So if someone didn't get married when they lived, they still need to be wedded after their death."

Does it happen in other places?

Most cases are found in northern and central China, areas such as Shanxi, Shaanxi and Henan provinces. But Szeto Fat-ching, a feng shui master in Hong Kong, also confirms the ancient form of the custom still exists among Chinese communities in South East Asia.

Image copyright Getty Images

In Taiwan, if an unmarried woman passes away, her family may place red packets with cash, paper money, a lock of hair, a fingernail out in the open and wait for a man to pick them up. The first man to pick up the packets is chosen as the groom and it is believed to be bad luck if he refuses to marry the ghost bride.

The wedding rituals are similar, but unlike in mainland China, no bones are dug up. The groom is often allowed to marry a living woman later, but his dead wife should be revered as the primary wife.

Last year a video of a ghost wedding from Taichung in Taiwan, where a man apparently "married" his deceased girlfriend in an elaborate ceremony, went viral.

At the core of these rituals is the universal human dilemma of how to deal with bereavement.

"Such ghost weddings are very touching, showing the perseverance of love," Mr Szeto told the BBC.