Image copyright Magnolia Pictures Image caption Dominic West has an encounter with Terry Notary, playing a performance artist, in The Square

Art world satire The Square, directed by Ruben Ostlund, has won the top prize at the Cannes Film Festival.

The Swedish title was one of 19 films competing for the prestigious Palme d'Or, in the 70th year of the festival on the French Riviera.

Prizes also went to British filmmaker Lynne Ramsay and director Sofia Coppola.

But juror Jessica Chastain said she was shocked at the way many of the films she saw at Cannes portrayed women.

Chastain, star of The Help said it was "disturbing" to see the way women were depicted on screen, saying: "The one thing I really took away from this experience was how the world views women. There are some exceptions, but for the most part I was surprised with the representation of female characters on the screen in these films.

"I hope when we include more female story-tellers we will have more of the women that I recognise in my day-to-day life, ones that are proactive, have their own agency and don't just react to the men around them - they have their own point of view."

Toni Erdmann director Maren Ade, who also sat on the jury, agreed more female directors were needed, adding: "We're missing a lot of stories they might tell."

Cannes: The winners

Palme d'Or: The Square

Grand Prix: BPM (Beats per Minute)

Jury prize: Andrey Zvyagintsev, Loveless

70th anniversary award: Nicole Kidman

Best director: Sofia Coppola, The Beguiled

Best actress: Diane Kruger, In the Fade

Best actor: Joaquin Phoenix, You Were Never Really Here

Best screenplay: Joint winners Yorgos Lanthimos and Efthymis Filippou for The Killing of a Sacred Deer, and Lynne Ramsay for You Were Never Really Here

Camera d'Or (best debut film): Leonor Serraille, Jeune Femme

Short film prize: A Gentle Night, Qiu Yang

Spanish director Pedro Almodovar, who chaired the jury, said the winning film was a rich and "completely contemporary" tale about "the dictatorship of being politically correct".

The director of Julieta and All About My Mother said the festival was "the birth of a lot of wonderful movies" and that he had been "completely mesmerised" by some of the films in competition.

Image copyright Reuters Image caption Left to right: Claes Bang, Elisabeth Moss, Ruben Ostlund, Dominic West and Terry Notary

But he appeared emotional when discussing how much he had loved Grand Prix winner BPM, which tells the story of activist group Act Up and the lack of government support for Aids sufferers in the 1990s.

"They are real heroes who saved many lives," he said, his voice breaking.

BPM had been a favourite to win the Palme d'Or, alongside bleak Russian family drama Loveless and heist thriller Good Time, with The Square an outsider.

Jury members also included Men in Black star Will Smith, South Korean director Park Chan-wook, Chinese star Fan Bingbing, Italian director Paolo Sorrentino, French actress and writer Agnes Jaoui and composer Gabriel Yared.

Image copyright Focus Features Image caption Nicole Kidman stars in Sofia Coppola's The Beguiled

British filmmaker Lynne Ramsay was the joint winner of best screenplay for You Were Never Really Here, for which Joaquin Phoenix was named best actor. It tells the story of a private contractor sent to rescue a young girl from a paedophile ring, and Ramsay said it had been a "labour of love", and that "to be recognised for the writing is great".

The best director award went to Sofia Coppola for The Beguiled, a drama about an injured soldier taken in by a girls' boarding school during the American Civil War - only the second time the prize has gone to a woman.

It stars Nicole Kidman as the headmistress and the Australian actress was given a 70th anniversary award to mark the fact she had three films and one TV series shown at this year's festival.

Image copyright Amazon Studios Image caption Joaquin Phoenix stars in You Were Never Really Here

The Square stars Claes Bang with British actor Dominic West and Mad Men's Elisabeth Moss in supporting roles. While it received good reviews, it was not tipped to win the main prize.

After winning, Ostlund said: "I think my first reaction was 'oh my God, how fantastic'. I mean I hugged the main actor that I've been working with almost for two years now. We have been struggling together and it was a very, very happy ending of that work of course."

Image copyright Alamy Image caption Ruben Ostlund punched the air as he posed with his prize

The Square focuses on Bang's character Christian as the gallery he runs prepares for a new exhibition in the gallery's courtyard in which members of the public can stand and ask for help. Meanwhile, his private life starts to unravel after he is mugged and seeks the return of his belongings in an unorthodox way.

It received four stars from the Daily Telegraph's Robbie Collin, who said that while it is a "slow burn", it has a "cumulative force that can't be resisted", while Peter Bradshaw in the Guardian gave it the same score, calling it "thrillingly weird".

The Swedish director was previously best known for Force Majeure, about a family ski trip rocked by a father's selfish reaction to an avalanche.

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.