A great challenge for Pakistan has been crafting a sense of shared identity. But with much of the ensuing identity politics spiralling into sectarian and communal violence in recent decades, it isn't surprising that minorities here face the worst forms of neglect and persecution.

There is no more maligned group of citizens in our country than those from its transgender community. Known variously as eunuchs, transgender or, in Urdu and Hindi, as hijras, they trace their origins to the pre-British royal courts of the Mughal empire and possibly even earlier, and are found not just in Pakistan but across the subcontinent. Under the Raj, the British tried to ban hijras as a breach of public decency but inevitably failed.

Although often described as eunuchs because some undergo castration, typically outside the clinical conditions of a hospital, many – if not most – do not.Hijras are in fact a diverse community of men (and some women) who happen to be hermaphrodites, transsexual, homosexual or have been castrated. Traditionally, hijras are viewed as having mystical powers – both good and bad – particularly with respect to marriage and fertility, which is why they are often found performing as dancers and soothsayers at weddings.

Sexuality is heavily regulated in Pakistan. Even for heterosexual couples relations are a hazardous affair, as brutally demonstrated by the recent murder of a British Pakistani family in Lahore last week – it is believed the murders were retribution for their son's alleged infidelity. For queer and transgender Pakistanis, however, the risks are far more ubiquitous.

Today hijras are universally marginalised, forced to earn a living as beggars, prostitutes and dancers. It is common to see hijras asking for money at major traffic intersections and busy bazaars, yet, sadly, few of us ever know these people as family or friends. Because a high number work in the sex industry, hijras are, according to Family Health International, particularly vulnerable to STDs. They are also exposed to sexual abuse by customers. One young traditional male dancer I met in Islamabad recently, for instance, had his face brutally disfigured by acid when he refused advances from a male admirer at one of his performances.

Pakistan's transgender community also faces persecution from the wider society. Brave activists like the She Male Association's Almas Bobby criticise the police for routinely harassing members of the community, as demonstrated at a high-profile rally in the garrison city of Rawalpindi in January last year.

On Tuesday, police in Peshawar interrupted a wedding by arresting a businessman together with his "eunuch" bride and up to 43 guests. The couple had to be escorted by a heavy security detail to court to prevent onlookers from assaulting them. Although rare, this incident is not unique. In 2007, a couple were jailed for seeking to get married because the groom was a woman who had undergone sex-change surgery.

It should be no surprise that Tuesday's arrest took place in a working-class neighbourhood of Peshawar. In Pakistan, the rich are generally free to do as they like. Although there are few recorded members of the transgender community among the elite, there is a vibrant if muted community of middle- and upper-class gay Pakistanis and one of the country's most popular talkshows is hosted by a drag queen.

In a photographic exhibition in Islamabad this month, the Scottish photographer Malcolm Hutcheson shines a spotlight on this ancient community. "It is not that these individuals belong to the dark side of the society; rather it is society itself which is dark, where they tend to see them [hijras] as inferior and neglect them," Hutcheson noted at the exhibition's opening.

But along with the indignities they have faced, there has been progress towards respecting the rights of transgender Pakistanis as equal citizens. Last year Pakistan's supreme court called on authorities to recognise hijras as a distinct gender that are entitled to inherit property, employment and to vote – albeit that these reforms will face stiff resistance in this deeply conservative country in which politicians are ever eager to display their Islamic credentials. In neighbouring India, a politician has suggested that a regiment of hijras should be established to act as security guards because of their "loyalty and integrity".

Pakistani society is immensely diverse, but with an all-too-often monolithic and intolerant mainstream conception of national identity it is frighteningly easy to face extreme prejudice and violence. Rather than expressing outrage over images of the Prophet on networking sites, it is high time we, as Muslims and Pakistanis, challenge the routine prejudice that condemns our fellow citizens to a lifetime of violence and ridicule. Accepting the ancient hijra community as a legitimate and diverse part of our society would be a welcome start.