David Burgess was the finest immigration lawyer of his generation, responsible for a number of trailblazing cases. Although known as David in his professional life, he was transgendered, and in recent years spent more time in his female persona, Sonia. He has died aged 63 after falling under a train at King's Cross tube station in London; a murder charge has followed.

In 1975, he co-founded the legal-aid firm Winstanley Burgess Solicitors, and his work for Tamil and Turkish Kurd refugees helped establish asylum work as a distinct legal specialism. A notable high-profile case was that of Viraj Mendis, the Sri Lankan asylum seeker who sought "sanctuary" in a church in Manchester before being forcibly deported in 1989.

Burgess's tenacity in support of another Sri Lankan, Saravamuthu Sivakumaran, was instrumental in the law being changed to give refugees greater rights to appeal against refusal of entry. In 1987, a group of 52 Sri Lankan Tamil asylum seekers was refused entry when they arrived at the UK border. In those days, there was no "in country" right of appeal, which meant the men would have had to return abroad to challenge the decision in the immigration courts. Burgess intervened to stop the deportation, using the only in-country legal remedy available, a judicial review of the decision to reject the asylum claim. Burgess won the case in the court of appeal, but lost in the House of Lords, and the men were returned to Sri Lanka.

In 1988, Burgess and a colleague travelled to Sri Lanka at the firm's expense to trace the men and gain evidence of the ill-treatment they had suffered since their return. An out-of-country appeal was mounted, and the men were subsequently accepted as refugees and allowed into the UK.

Immigration law was still in its infancy at the time, with the special status of refugees receiving scant legal recognition. Although Burgess lost when the case reached the European Court of Human Rights (ECHR) in 1991, by which time it was known as Vilvarajah, the episode highlighted the inadequacy of judicial review as the only in-country means of challenging a refusal of entry. The law was subsequently changed, giving asylum seekers the right to appeal without having to return to the home country.

In 1996, Burgess acted for Karamjit Singh Chahal, an alleged Sikh militant facing deportation to India, where he claimed he would be at risk of torture. In a landmark decision, the ECHR ruled against deportation, maintaining that protection against the risk of torture is absolute, even for those who may pose a security risk to the UK. The Chahal judgment was instrumental in preventing the deportation of terrorist suspects rounded up after 9/11 under the so-called "Belmarsh powers".

In 1991, Burgess caused the then Conservative home secretary, Kenneth Baker, to be found in contempt of court for failing to stop the deportation of "M", a Zairean asylum seeker. The case established that government ministers can be held responsible for their actions, and Professor Sir William Wade described it as the most significant constitutional case for more than 200 years.

However, the circumstances that led to the 1994 House of Lords ruling read more like a Dario Fo farce. M was a teacher from Zaire, whose earlier asylum claim, through a different firm of solicitors, had failed. On 1 May 1991, half an hour before M was due to be flown out of the UK, Burgess (who had only taken on the case that day) filed a fresh asylum application. The court asked for (and understood that it had received) an undertaking from the Treasury solicitor to stay deportation. Government officials phoned Heathrow (where M's plane was waiting to depart), but were put through to the wrong terminal. M's plane duly took off.

Meanwhile, the Treasury solicitor claimed that he never intended to give a binding undertaking anyway, and did not believe that he had. Discovering his client had been deported, Burgess phoned the judge at home at midnight. The judge ordered M's return. Arrangements to fly M back to the UK were made. Baker, acting on legal advice, ordered the arrangements to fly M back to be cancelled. By this point, M had disappeared, and was believed to have fled to another African country.

Outraged at the home secretary's failure to comply with the judge's order, Burgess began contempt proceedings and pursued the case all the way to the Lords. Ruling against the government, the law lords spared Baker a fine, but he was ordered to pay costs.

Burgess was not only fearless, but thorough. Sir Nicholas Blake QC, now a high court judge, worked with him on the Chahal case, and recalled that Burgess completely outgunned the government's legal team. After travelling to India to amass evidence of the risk of torture, he had prepared four volumes of "cogent material as to the existence of risk, whereas the attorney general of the day could only respond with a thin file of generalised press cuttings".

Although known as David in his professional life, Burgess was transgendered, and in recent years spent more time in his female persona, Sonia

Burgess was born in Castleford, West Yorkshire. His mother, Comfort Burgess, was a secondary school headteacher, and he had an older sister, Ros; David never knew his father. He went to boarding school in Skipton, and was a devoted rugby league fan, a passion he shared with his grandfather.

In 1966, Burgess went to St Catharine's College, Cambridge, where he met Robert Winstanley. Burgess was openly bisexual and had committed relationships with both men and women. After gaining an upper-second law degree (1969), he completed articles at a firm in Skipton, before joining Winstanley at Dawson & Co in Lincoln's Inn, central London, in 1972. Three years later, the pair set up on their own in offices above a pizza restaurant opposite Islington Town Hall.

Burgess had already been doing voluntary work for the Joint Council for the Welfare of Immigrants, and rapidly began to build his reputation in immigration law. He was less well known for his work representing transsexual clients, but over a 16-year period was to take three major cases to the ECHR, seeking to win full legal recognition of their changed gender status. His cases included that in 1986 of Mark Rees, a female-to-male transsexual, who sought to have the gender on his birth certificate changed. Rees would later pay tribute to Burgess's work in his 1996 autobiography, Dear Sir or Madam.

In 1985, Burgess had married Youdon Lhamo, a Tibetan refugee, who worked as a nurse. They had a son and a daughter and, in 1987, they adopted Youdon's seven-year-old niece, whose family had been living in exile in northern India. All three children now live abroad.

Winstanley Burgess expanded rapidly, moving into bigger offices and adding extra partners. Burgess's caseload was enormous, his commitment to clients all-consuming and he would regularly work 13 hours a day for six or sometimes seven days a week. He acknowledged the inevitable toll on family life and the degree of support he relied on from Youdon and his children.

In 1996, the firm faced upheaval when Winstanley, who specialised in criminal defence work, left to become a judge. It was an amicable parting and the pair continued to meet to play snooker.

Winstanley had always been the more business-oriented of the two, and his departure coincided with wider changes in the profession. The Legal Services Commission, which by then was running the legal aid scheme, was seeking to control the spiralling budget with a series of "quality reforms" For a passionate, coalface lawyer such as Burgess, the shift to a culture of clock-watching and box-ticking was never going to be an easy one.

In 2003, the firm folded, with Burgess burned out from years of dealing with clients traumatised by torture, rape and much else, and by the political and media abuse heaped on asylum seekers and their lawyers. He had no clear idea of what he would do next. Issues around his gender identity, which had been with him since childhood, also became more pronounced. He spent a period in Tibet, learning the language, before returning to the UK. In 2005, he separated from his wife, and three years later the couple were divorced.

Burgess did not stay away from refugee work for long and, in 2005, began working part-time for the Medical Foundation for the Care of Victims of Torture. More recently, he had also been working part-time at the north London law firm Luqmani Thompson, and was active in his local church in central London.

Burgess continued to be David in his professional life, but made no secret of his identity as Sonia to friends and close colleagues, who believed that he was moving towards being Sonia full time. He is survived by Ros and his children.

• David Burgess, lawyer, born 25 September 1947; died 25 October 2010