It is mid-afternoon and, in a field in rural Tanzania, a meeting about HIV services has turned into an impromptu karate lesson. Families laugh as people take turns to practise with Sister Kate. This is not how most nuns do community outreach.

It’s more than 30 years since Kate Costigan – a motorbike-riding, karate black belt – left her home in Tipperary, Ireland. At 19, she entered the Missionary Sisters of Our Lady of Apostles, travelling first to Nigeria and later Tanzania. “My father wanted me to join a local order, not [be] a missionary that was going far away,” she remembers. Her family, not to mention her boyfriend at the time, were all a little surprised.

Today, Costigan is at the forefront of an HIV campaign that could be a template for other low-income countries. The programme – run jointly by pharmaceutical company Gilead Sciences and the Vatican – is promoting mass checks, with treatment then offered to anyone who tests positive, regardless of their clinical stage. The World Health Organisation believes this approach, offered alongside other prevention methods, could prevent 21 million deaths globally, even if there remain questions about how feasible mass testing is in countries where resources are scarce.

In Shinyanga, experts are hoping to reach 300,000 people by moving care into the community – establishing peer-support clubs where treatment can be distributed locally, and using the vast social networks of the Catholic church. Costigan rides a motorbike to deliver HIV care to local villages quickly, while churches invite health experts to give seminars on getting tested. “[Before] there was antiretroviral therapy but people did not accept it. People were dying,” says Bernard Desderius, chief of HIV medicine at Bugando medical centre.

In Tanzania, two-thirds of the population are Christian, and the church has the power to shape attitudes. Thirty years ago, in the Mwanza region in the north-west, Pope John Paul II gave a speech that made the Vatican’s fierce and controversial opposition to condom use clear. Since then, its stance on prevention has been widely criticised by HIV experts, including the World Health Organisation.

On the ground in Tanzania, people take a pragmatic approach. Costigan follows church teachings but says: “We don’t give out condoms but they know where they can get them and they’re always given proper information.” A family planning team gives out advice. “You don’t ever judge someone who is sick. You’re there to provide care, love, compassion.”

People at a meeting about HIV services – in Tanzania, there are still more than 30,000 deaths from Aids-related illnesses every year. Photograph: Barak Kassar/Gilead Sciences

Elsewhere, others are more outspoken. “Even the priest himself advised I use condoms,” says one woman, outside Bugisi. She now works as an HIV counsellor and advises everyone to use protection.

Across Tanzania, there are still more than 30,000 Aids-related deaths a year. The disease has devastated families, says Father Kizito Nyanga, assistant bishop for Shinyanga. “There are many who have died and they have left children, some healthy, some sick.” However, he does not advise people to use condoms. Instead, he encourages people to be faithful, to get tested and stick to treatment.

Though antiretroviral therapy is widely available, the fear of blame or discrimination deters people from discussing it with relatives. The UN agency for fighting HIV, UNAids, has warned that stigma and discrimination are still a concern in Tanzania, citing the crackdown on services supporting lesbian, gay, bisexual and trans people as a particular concern.

Shame is often linked to moralistic attitudes. Elizabeth, a farmer with six children, found out that she was positive in 2016 but has not told friends or family. Her children have all tested negative and her partner is OK, but she says: “I feel shy to tell. People think HIV is something you can only [get] if you are a prostitute.”

In Shinyanga, clubs for people with HIV are being set up in villages where issues, such as discrimination, can be discussed. Patients will also be able to pick up their medication from the clubs, so that they no longer have to make long journeys to a clinic, which can take up to four hours by bicycle.

It is hoped that this approach will help to cut the persistently high numbers of people who drop out of care – across the country, around a quarter of people do so.

In the past year, more than 110,000 people have been tested in Shinyanga. And patient information for half of the 3,000 on antiretroviral therapy shows that the virus is undetectable in 90% of cases. This means there is no risk of passing on HIV if each person stays on treatment. “It’s not enough to discover new medicines if you don’t actually enable patient access and figure out what drives patient access,” says Anand Reddi, senior manager of international operations at Gilead Sciences.

For Costigan, it is building trust with communities that is most crucial. You can give all the drugs in the world, she says, but this alone will not fight HIV. “You need someone who is very compassionate when you’re giving out drugs.”

• Gilead Sciences paid for accommodation during the reporting of this story