A handful of inmates are gathered in the library of the Arthur Gorrie Correctional Centre in Wacol, 20 kilometres south-west of Brisbane. The centre of attention is Kia, a boisterous young Staffordshire bull terrier. As the dark-brown dog does laps of the group, sniffing at thong-shod feet, gratefully receiving rough pats and gulping water from a plastic bowl on the carpet, the four men follow her with their eyes.

“There’s a lot of bravado in here,” says Ricky, a muscular, tattooed man with a shaved head. “When we have a dog, it tones the unit down. To pat a dog, you’ve gotta soften your heart. You can’t be looking tough when you go, ‘Hello, good girl! Why’s your tail like that for?’” His voice rises an octave as he addresses this last part to Kia and forcefully pats her flank. The dog looks up at him, confused.

“It’s good responsibility for us as well,” says the big, bearded Alex. “Cleaning up after poo and wee, picking up rubbish lying around. People throwing stuff in the unit – you’ve gotta stop that when there’s an animal around.” On the outside, Alex bred Shar Peis, a breed known for their wrinkled features. In here, his favourite is Pippy, a fluffy, white Maltese aged three. “She’s lovely all round.” He grins at the anxious animal as she’s led into the room on a leash, warily eyeing off Kia. “She’s perfect.”

Pippy was donated to RSPCA Queensland through the Pets in Crisis program, indicating that she and her owner were fleeing domestic violence. Since early 2013, the RSPCA’s Wacol campus has teamed up with staff and inmates at Arthur Gorrie to run the Bars and Rehabilitation Kanine (BARK) program. During that time, 54 abandoned or surrendered dogs, some with behavioural or medical problems, have been placed in prison units of up to 70 men, who act as foster carers for the animals until they’re adopted in the community or can be returned to their owners. A similar program at the nearby Brisbane Women’s Correctional Centre partners cats with female inmates.

In the prison library, Ricky is the only one not wearing a uniform of green shirt and shorts; a red shirt denotes his role as a mentor for inmates struggling to adapt to their new environment. “There’s a lot of mental illness in here, believe me,” he says. “And most of us guys have trust issues.” He raises his hand. “I, for one. This program does help instil that little bit of trust again. It may be with an animal, but it’s a start.”

The men cite separation anxiety as an ongoing issue, as their four-legged friends are only ever temporary visitors. Saying goodbye can be difficult. “But I’m at the point now where I feel really good that I’ve played my part in that dog’s rehabilitation, and that it’s going to a good home with good training,” says Ricky. The others nod in agreement. “That’s a good feeling for us to have – and that’s what we need to leave the jail with, as well. That feeling of worth, getting that bit of joy back in the heart.”

As we wend our way through the prison’s series of fenced walkways, Jasmine Lebet, an RSPCA Queensland foster-care assistant, holds Kia’s leash firmly. “These dogs don’t cope in a shelter environment,” says the chirpy 25-year-old. “So to send them here gets them away from the chaos of a shelter. It helps them relax a bit more.”

We approach a policeman in sunglasses and navy fatigues, standing guard with an enormous black German shepherd by his side. Lebet and prison staffers make encouraging noises at Kia when she walks past without showing aggression.

In the harsh midday light, two other inmates, Angus and Phillip, stand on the grass while an intelligent, tan-coloured kelpie named Jax silently regards the sterile world around him.

“I used to sit in my cell of a night-time, just worrying about my dog,” Phillip says of life when he first got locked up, “but since I’ve been looking after these dogs, I find it a lot easier.”

When Jax cocks his leg to piss on my shoes, Angus quickly intervenes and apologises for the animal. “The dog’s always happy to see you,” he continues. “When you’re taking the dog for a walk out on the oval, you could be anywhere in the world – at least for a couple of minutes.”

“‘Dog’ is a bad word in this place,” says Phillip, referring to the prison epithet for an informant. He cracks a smile. “It’s still a bad word, but there are two different types in here now.”

Inmates’ names have been changed.