New York indie star Adrienne Shelly had everything to live for: her husband, young daughter, and a brilliant movie she'd just directed and starred in. Why, then, would she hang herself in her shower? In fact, she was murdered. As the film, Waitress, is released, we report on her tragic death - and the remarkable success of the film she left behind

On 1 November last year, the day after Halloween - a night that tends to turn all of New York City into a bacchanal of spooky and elaborately costumed glee - a woman working in a Greenwich Village apartment was found hanging by a sheet in her shower.

The woman was Adrienne Shelly, an actress who for a certain generation of independent cinema lovers was something of a muse. Petite, and beautiful in a way that might have been reminiscent of Brigitte Bardot had Bardot also been brainy, funny and precise, Shelly had come to public attention as the star of Hal Hartley's first two films. A cult figure by the mid-Nineties, queen of the New York indie scene when that scene was at its zenith, she had gone on to direct three films of her own. The third, Waitress, had been recently completed and entered for the Sundance Film Festival. Shelly had spent those last few days on tenterhooks, waiting to hear if it had been accepted. A lovely, spiky, Technicolor fable about a waitress in an old-school Southern diner whose ingeniously titled pies prove curiously redemptive, Waitress was Shelly's most accomplished and accessible film by far. The night before she died, she spoke to her producer, Michael Roiff, and they joked about whether they should send the Sundance judges some pies. 'Do you think they should be making this decision on an empty stomach?' they asked each other. It never occurred to Roiff that he would not be speaking to Shelly again.

The idea that this woman - in the prime of her 40-year life, at the peak of her career, in the throes of mothering a three-year-old daughter she adored - should have killed herself was difficult to consider, and Shelly's husband, Andy Ostroy, was convinced that suicide was impossible. She would never have left her daughter intentionally, he told police, and over the next few days, thanks to his insistence and a more thorough examination of the crime scene, he was proven right. 'He was her hero,' Shelly's good friend Sasha Eden later told me, 'even in her death. Andy did everything in his power, and made the whole murder come out.'

Next to the shower where Shelly was found, a muddy Reebok footprint had been left on the toilet. Detectives were able to match it to footprints in the apartment directly below Shelly's office. They traced them to a 19-year-old Ecuadorean construction worker named Diego Pillco, who subsequently confessed to Shelly's murder.

That day, he said, Shelly had come down to the apartment where he was working and complained about construction noise. He didn't speak much English, having recently arrived in the United States, but he understood when she threatened to call the police. Fearing that he would be deported if the police were called, he threw a hammer at Shelly and followed her back up to her apartment. There, she slapped him and he knocked her hard enough to make her fall back and hit her head against a table. Assuming the worst, he tried to cover up his crime by making it look like a suicide. He took a sheet from the bed and tied Shelly to the shower rail.

The postmortem later revealed that the blow had not killed her. She died of compression to the neck: in other words, the cover-up was the fatal aspect of the crime. Despite his confession, Pillco pleaded not guilty; he was held without bail and is currently awaiting trial for second-degree murder.

As for Waitress, the Sundance judges had already made their decision to accept it, but Shelly did not live to hear the news. It premiered there in January, without her.

'Seeing Waitress at Sundance was a really emotional experience,' says Nancy Utley, chief operating officer of Fox Searchlight, which entered a bidding war to distribute the film. 'The typical format for the festival is that the director is introduced to say a few words before the film begins. It was painful from the beginning to see that there was no director to introduce the film, since Adrienne had passed away. So the producer and Adrienne's husband Andy talked about how it had been Adrienne's dream to have a film at Sundance. It was very poignant.'

At that screening, Utley says, 'the movie played like gangbusters. The audience was laughing and crying, and sometimes both at the same time. There was a standing ovation at the end.'

Utley and her colleagues at Fox Searchlight are leading the Hollywood pack in terms of turning small movies into big hits; the previous year they had discovered a small-budget film at Sundance that went on to enormous box office success and several Oscar nods: Little Miss Sunshine. Before long, Waitress became known as 'this year's Little Miss Sunshine'. Within a few weeks of its release, Shelly's low-budget film had grossed more than $17m, and Utley suggests there are already signs that recognition may come in the form of Golden Globes or Academy Awards.

Waitress follows the travails of Jenna (played by TV star Keri Russell), who finds herself pregnant by the abusive husband she has been saving up money to leave. Every day in the diner where she works, she invents a new kind of pie, and these, she hopes, will be her saving grace: if she wins the Jonesville bake-off, she'll finally be able to jump ship. Meanwhile, the pies she brings her gynaecologist lead him to fall in love with her; soon, she is sleeping with the doctor, feeling ambivalent about the baby and unable to compete in the bake-off because her husband won't let her go. The plot builds up through her daily concoctions: 'Baby Screaming its Head Off in the Middle of the Night and Ruinin' my Life Pie' is followed by 'Earl Murders Me Because I'm Having an Affair Pie'. Her friends and co-waitresses offer moral support - there's Becky (Cheryl Hines), who's secretly dating their boss, and Dawn (played by Shelly herself), a small, mousy woman who finds happiness with a dweeb because he invents fantastically bad poetry in her honour. In the end, it's not only lucky circumstance but Jenna's baby, with whom she falls in love at first sight, that give her the strength to find a way out.

'Her writing is a great representation of who she was,' says Sasha Eden. 'It's irreverent, it's funny, it's courageous, it's sparkly, there's something fantastical to it.' Both Shelly's producer Michael Roiff, whose first film Waitress is, and her co-star Cheryl Hines remember a particular moment in the whirlwind 20-day shoot as being quintessentially 'Adrienne': they were filming the scene in which Shelly's character gets married, and Shelly would come out of character, still in costume, to direct the scene. 'Why is everyone staring at me?' she asked, while the others laughed at the incongruity of the image. 'That was who she was in a nutshell,' Roiff suggests. 'She could wear a wedding dress in the middle of a movie set, get behind the camera and not think anything of it.'

Her multi-tasking also made a political point that was close to her heart. Shelly wrote Waitress when she was pregnant with her daughter, Sophie, who was a toddler by the time it was shot. 'No one questions Woody Allen or Christopher Guest,' Eden points out. 'But when you're a woman it's much more challenging. Here was this gorgeous writer-director-actor who had to constantly prove that she could do it.' Roiff recalls that when they were editing the film in its final stages, 'one of the things she was most excited about was the fact that she had done this as a woman and as a mother. She was an amazing mum, and I remember one day when we had watched a cut of the film, she turned around and said: "Look, you can do it. Society wants to tell you that you have to choose, but you don't have to choose." To a huge extent, that's what the film's about. Is this the end of Jenna's life? No, it's just the beginning.'

Though one of the movie's greatest attributes is that Shelly was able to weave different emotions into a stylised, laconic yet funny and very moving whole, at least one aspect of its emotional overload is unintentionally unbearable. Sophie Ostroy plays Jenna's daughter as a young child - by which time the mother and daughter characters have become inseparable companions and partners in pie-making. The film ends with a shot of Keri Russell and a tiny Sophie walking down a dirt road in matching Fifties waitress dresses, while on the soundtrack a lullaby written by Shelly and sung by Jenna to her daughter plays one last time:

'Baby, don't you cry/ Gonna make a pie/ Gonna make a pie with a heart in the middle/ Baby, don't be blue/ Gonna make for you/ Gonna make a pie with a heart in the middle/ Gonna make a pie from heaven above/ Gonna be filled with strawberry love/ Baby, don't you cry/ Gonna make a pie/ And hold you forever in the middle of my heart.'

Andy Ostroy's office in Chelsea, from which he runs his own marketing company, is papered with family photographs. Among them are pictures of Sophie, of his three children from an earlier marriage and some beautifully pale and glamorous portraits of Shelly, intentionally designed to look like faded relics from the Fifties. It is not much longer than six months since his wife's death, and there are certain things that are too raw or too personal for Ostroy to discuss: the murder itself, or, for instance, the gruesomely opportunistic episode of Law and Order - a show on which Shelly herself had once appeared as a guest star - which took the story of her murder and ran with it into several dozen fictional plot twists. Ostroy's aim is to speak about his wife's talents, her latest film, and the foundation to support women filmmakers that he's set up in her name.

'The first time I saw the movie after she died, as suspected, it was a little difficult,' says Ostroy, a direct, calm, appealing man. 'But you do get lost in the characters. That's why the film stands on its own - you watch it and in five minutes you forget what happened to Adrienne.

'The role she plays in Waitress is more true to who she really was than anything she's ever done,' he goes on. 'She's always known for dark, mysterious ingenues, but deep down she was just a clown. She was a very, very silly person - she didn't take herself or life very seriously - and I'm sorry that the filmgoing audience never got to see who she really was. She was more comfortable with that part of herself much later on. She was the funniest woman I ever met in my life.'

Ostroy and Shelly met not long after 9/11. They had been set up by mutual friends. 'I didn't really know what to make of her at first,' Ostroy recalls. 'She was like no one I'd ever met. But I knew right away that she was special. There are very few people in this world who are really unique, and she touched you in a way that meant you could never forget her. It's hard to explain. She had a big smile and a genius IQ.'

Ostroy believes she was destined for greatness. 'I always said to her, "Your forties are going to be amazing." I knew this film was going to put her in another league. She'd been toiling for 20 years, but through Waitress it was almost like she was an overnight success again. And, you know, that's the tragedy of it - that she's not around to experience the success.'

Almost two decades ago, Hal Hartley came across Shelly's picture by serendipity. He was casting his first film, The Unbelievable Truth, which had a budget of just $75,000, and someone else in his office, who was trying to cast a music video, held up Shelly's head shot. 'What about her?' he said, and the rest is movie history.

Hartley came to specialise in a genre all his own: it had the absurdist hallmarks of Godard, the barren, stifling precision of Bresson, yet it was invariably set in suburban Long Island, where Hartley grew up. By coincidence, Shelly grew up there too, and she became his Anna Karina - a doll-like fatalist on whom male characters could project their apocalyptic fantasies. The year after The Unbelievable Truth was released, Hartley wrote Trust, his best film, with Shelly in mind. His directions were so minimalistic ('Less, less, less: I don't want to see anything on your face at all'), she later said that she sometimes wanted to kill him. But she absorbed his auteurism wholeheartedly.

'When you look at Waitress, you see the best of her writing,' Hartley said at this year's Sundance Festival, looking back on the time they had spent together and reflecting that her writing talent was 'definitely one of the reasons I cast her when she was 22. She immediately caught on to the rhythm and irony in my movies. And she always appreciated that when she began her own writing.'

By 1996, Shelly had set up a theatre company called Missing Children, written several plays, and directed her first feature, Sudden Manhattan. A comedy of errors in which the predominant error seems to be that everyone is in love with her character, Sudden Manhattan owed a debt to both David Lynch and Woody Allen, and featured Shelly as a quirky, ingenuous version of herself.

In 1999 she wrote and directed I'll Take You There, which starred Ally Sheedy, and continued to work regularly as an actress in independent movies. 'Adrienne had many opportunities, particularly in the Nineties, to pursue the Hollywood route, but she just didn't want to be a part of it,' Ostroy tells me. Her most recent appearance was as a French millionaire's slutty lover opposite Matt Dillon in Factotum. But she reserved her greatest happiness for writing and directing. It was what her family always thought she'd do - in fact, when her acting abilities were praised as a child, Shelly's father shot the compliments down: 'I will not have my daughter jumping out a window when she's 30.'

Two years after he said that, Shelly's father died suddenly. She was 12 years old. Shelly, who was born Adrienne Levine, took her father's first name as her professional surname. The effect of his death, she once said, was that she'd 'gone through life with this feeling that life could end at any given moment'. She even quoted Kierkegaard on the subject: 'Don't make plans for the future without adding the phrase: "However, I might be dead in the next 10 minutes, in which case I shall not attend to it."' She was remarkably philosophical, and guardedly optimistic. Or, as she herself put it with characteristic wryness: 'I'm as optimistic as someone who is mainly Russian in her genealogy can be.'

'What's interesting is that she was finally starting to savour people a bit more and not worry that they'd be gone,' Michael Roiff suggests of her final years. 'There was a calmness to her. She would say to me: "You met a very different Adrienne from the one from 10 years ago." I don't think she meant it grandly - I think she meant little things, like she showed up on time more often,' he laughs. 'But she had got to a place where she was truly happy.'

Sasha Eden, who runs a theatre company called Women's Expressive Theater, and who organised the star-studded stage reading of Waitress that eventually led to its funding, first met Shelly when she was in college and Shelly was at the height of her indie popularity. 'She was who I wanted to be when I grew up,' Eden says now, 'and years later she ended up being like a big sister to me. I planned her bachelorette party, I danced at her wedding... She had all the answers. What's painful is that she was one of those sages that all of her friends looked up to, so when she passed away she left so many lost souls.'

Intimate reports of Shelly universally suggest a paradox: a vulnerable-looking person who would make clear, within minutes of meeting her, that the fragility was just a mirage; a resolute woman with, in her own estimation, 'a really sensitive bullshit detector' who nevertheless had time for everyone; a deep, omnivorous reader who embraced slapstick in her daily life, appearing at any given gathering in a flowery hat, armed with the most infectious laugh, and still commanded the greatest respect.

'She had a gift for winning people over,' Andy Ostroy tells me. 'It wasn't insincere. She would always say, "Show people kindness, and it will come back to you." I'm sort of the other extreme: a born and bred New Yorker, push me and I'll push back harder. I see it now - I didn't see it as clearly then: she was totally non-judgmental, almost unconditional, very accepting of people's flaws, and that gave her the ability to go through life on a fairly even keel.'

The Adrienne Shelly Foundation, which Ostroy has set up in her honour, exists to encourage women to make films. It offers - and has already awarded - college scholarships, production grants and living stipends. It has joined forces with Columbia University, NYU and the American Film Institute and is in talks with Sundance. Its advisory board members include Hal Hartley and Rosanna Arquette, and it is planning a fundraising performance of Shelly's earlier script, The Morgan Stories, that will star Edie Falco, Debra Winger and Paul Rudd.

'I think Adrienne would be very proud that in her name other women are being helped in ways that she wished she could have been,' Ostroy says. 'Given what happened to her, there's so much positive that can come out of it - that's the reason behind the foundation: to try to take something horrible and make something positive. Everybody deals with things in their own way - I'm dealing with things in my way.' Ostroy is now in the process of producing one of the scripts Shelly left behind, and looking for a strong female director.

'You know, I'm a big Jimi Hendrix fan,' Ostroy says, and it takes me a moment to understand why he's telling me this. 'He's been dead something like 37 years and he still puts out albums,' Ostroy smiles. 'As long as the work is there, and there are people willing to bring it to life, you haven't heard the last of Adrienne Shelly.'

· Waitress is released in the UK on 10 August. More information about the Adrienne Shelly Foundation can be found at adrienneshellyfoundation.org

Adrienne Shelly: A life

Born Adrienne Levine on 24 June 1966, Queens, New York. Raised on Long Island, New York.

Education Appeared in a professional production of Annie while still at high school. Studied film production at Boston University but dropped out after a year.

Career Achieved fame with several starring roles in Hal Hartley's indie films, before moving on to direct Sudden Manhattan (1997) and I'll Take You There (1999). Directed, wrote and starred in Waitress (2007), which was released after her death and has been a box-office success in the States.

Love and family Married to Andrew Ostroy, chairman and CEO of marketing firm Belardi/Ostroy ALC. One daughter, Sophie, born in 2003, who also appears in Waitress

Death On 1 November 2006, Ostroy found Shelly hanging from the shower rail in her office. Diego Pillco, 19, has been charged with her murder .