In 2008, a 21-year-old Russian called Irina Popova went to St Petersburg on an odd assignment – to make a photostory about "feelings". No novice, she'd been studying and working as a photographer since the age of 16. But she didn't know the city well, and a trip to a nightclub in search of material proved disappointing. Outside the club, though, at around two in the morning, she spotted a woman having a pee in the street. Captivated by the woman's appearance and intrigued by the fact she had her baby daughter with her, in a pushchair, Popova asked if she could take some photos. The woman – Lilya – laughingly obliged, striking different poses, one of them face down on the pavement. She was drunk, or high on drugs, but clearly enjoyed performing for the camera: she had once dreamed of being a model or a porn star. She ended up asking Popova back to the apartment where she lived with her boyfriend Pasha ("Dandelion" as she called him, because of his curly hair), the father of her child, Anfisa.

The apartment was just a single room, with access to a communal kitchen and bathroom, but Popova moved in for the next two weeks, sometimes acting as nanny to Anfisa. She also took photos. The picture in the lens wasn't pretty. The apartment was less a home than a club for dropouts and junkies. Occasionally, Lilya would go out, to get money for drugs, and once she climbed inside a hole or drain on a building site, so that Popova could get a good shot. But mostly she, Pasha and their friends spent day and night behind thick curtains, drinking, watching horror movies and playing loud music. And through all this, among empty beer bottles, dirty blankets and cat shit, 18-month-old Anfisa would be crawling around, occasionally amusing everyone by putting her mother's cigarettes in her mouth.

Despite the chaos, Popova felt Anfisa was genuinely loved and generally well cared-for. And though some of what she observed horrified her, the longer she spent there, the more "normal" it all seemed. "My critical judgment turns off," she wrote in a diary. "I immerse in this atmosphere and it becomes a part of my life. Now they are just nice people. Family. My friends. I'm starting to feel good with them (how I suffocated before!). I stop perceiving their lifestyle as destructive." Yet the experience was emotionally exhausting, and it depressed her to think that Pasha and Lilya (both in their late 20s and therefore older than she was) would go on living as they did and never changing.

She left to cover the war in Georgia, relieved to be gone but with a series of photos and the makings of a story. What exactly was the story, though? When she began to put together an exhibition for a gallery in St Petersburg, she found that the curator didn't see it as she did. Among the feelings she thought she had found was love, whereas he saw degradation and despair. And far from her simply documenting how Pasha and Lilya lived and allowing viewers to make their own judgment, he saw the photos as a condemnation. Her own selection of the pictures would have been different, but they agreed that what was best about them – "the spoonful of honey in a barrel of tar" – was the beauty of Anfisa. At least Pasha and Lilya took it all in good heart. She had already been to see them to ask their permission to display the photos, which they cheerfully gave. And when they came to see the exhibition, they had a good laugh about it, amused to think that anyone should be interested in their lives.

The show was well received and the photographs were later nominated for an award. But when Popova published some of them on the internet, bloggers in their hundreds hurled abuse. They were outraged that anyone should live as Pasha and Lilya did. Outraged that they should be allowed to raise a child in those conditions. Outraged by photos showing Anfisa next to a naked penis. And outraged that the photographer hadn't reported the parents to the authorities. Someone wrote a letter to the police. There was talk of prosecution. A campaign began to remove Anfisa and put her in an orphanage.

Alarmed, and knowing how grim Russian orphanages can be, Popova went to St Petersburg to tell Pasha and Lilya what had happened. They weren't people who used the internet much and their first reaction was to laugh and wonder what the fuss was about. It was only when she told them that the police had been asking her for their address that Pasha lost his temper and refused to have any more to do with her (a position he still maintains). As usual, Lilya was more relaxed and amenable, and even agreed to be interviewed for a film Popova was now planning to make. In the interview she talked about their lifestyle as a kind of philosophical experiment – how far could they go to find an alternative way of living? But she also admitted they'd hit bottom and hinted she might be ready for a change.

The story of the photos raises a number of fascinating issues: about exploitation, voyeurism and embedded reportage; about the moral responsibility of a photographer or any artist who deals in non-fiction; about the differences between images seen in a gallery and images posted online; and about the meaning of informed consent. In moving in with her subjects, Popova was doing what the great Walker Evans did in the 1930s when he and James Agee moved in with a sharecropper family while working on a magazine piece that turned into the book Let Us Now Praise Famous Men. And, like Evans, she was accused of exploiting people too naive and destitute to understand the implications of what they'd agreed to.

Still, Popova was young when she took her photos and couldn't have foreseen the storm that would follow their publication. It was said – as is sometimes said with war photographers – that she should have done something to help, rather than pointing the camera. She admits she dissolved into the background during her stay, but she wasn't indifferent. One photo in particular illustrates the point. It shows Anfisa crawling towards a window ledge, seemingly in danger of falling out – a photo as scary as the famous one of Michael Jackson dangling his child from a balcony. The shot wasn't a set-up. But nor was the danger quite as grave as it looked. Popova had a hand free ready to grab the child. In the event, Lilya grabbed her first. And though no one would have trusted it, there was also a safety net below the window.

Nevertheless, to innocent viewers Anfisa must have looked at risk of suffering the fate of the baby in Irvine Welsh's Trainspotting, which starves to death while its druggie parents are off their heads. Popova's chief regret now is not so much the photos but the captions and texts that went with them, which emphasised squalor and neglect and said nothing about love. She felt loyal to Lilya and Pasha: "They let me into their life and they accepted my interference into their privacy." It distressed her to see them vilified, and for her attempt to show that there's no Them and Us – "no line between the bottom and the civilised" – to have been misconceived or misunderstood.

The story isn't finished, however, and in the long run having their private lives held up to a public mirror may have had a positive effect on the family. Lilya disappeared six months after the controversy: given her heavy drug use, and how vulnerable she was, people feared the worst. But it turned out she had gone home to Stavropol, where her parents live, and was receiving treatment for her addiction. Six months later she returned to St Petersburg and found a job in a clothes shop. She no longer lives with Pasha.

He, too, has a different life, working part-time as an electrician. He lives in the same St Petersburg apartment, with Anfisa, but also with a new partner and her son. Neighbours who used to complain about him say he's calmer, more communal-minded and no longer takes drugs. He's also a good father to Anfisa, who attends kindergarten and shows fewer signs of damage or arrested development than feared. She's still pretty and photogenic – his "princess" as he calls her. But when the photos Popova took are published in a book next year, along with diaries she kept and the angry blogs, it's a safe bet Pasha won't be giving interviews or going anywhere near a camera.