In a surprise verdict, the Japanese film Shoplifters, directed by Hirokazu Kore-eda, has been awarded the Palme d’Or for main feature at the close of the Cannes film festival. “The ending blew us out of the cinema,” said jury president Cate Blanchett.

Beating a field of 21, including two or three titles that had been hotly tipped for the top by the critics, the film took the prestigious prize on Saturday night ahead of the screening of the final film of the festival, Terry Gilliam’s long-awaited adaptation of Cervantes, The Man Who Killed Don Quixote.

A special Palme d’Or award was made to the 87-year-old French Swiss film director Jean-Luc Godard for his film Image Book. Godard’s film, Blanchett explained, “almost sat apart from the other films, almost outside time and space”, and so could not be considered against them.

Spike Lee’s anti-Trump comedy BlacKkKlansman was runner-up, receiving the Grand Prix, with the third prize going to a film by a Lebanese female director, Nadine Labaki, that had been rewarded with an ecstatic ovation towards the end of the 10-day annual festival on the Côte d’Azur. Capernaum, Labaki’s heart-wrenching attack on the needless suffering of children, was the favourite of Oscar-winner Gary Oldman, who told the press he was backing the film as he walked the red carpet last night.

A still from Shoplifters: ‘The ending blew us out of the cinema’ Photograph: Fuji Television Network/Gaga/AOI Pro

Other favourites included Burning, made by Lee Chang-dong, which earned the highest score from critics ever recorded, and one of the earliest films screened at the festival, Pawel Pawlikowski’s Cold War.

The prize ceremony was marked this year not just by the unexpected winner – the story of a family of petty criminals scraping a living in downtown Tokyo – but also by the passionate speech given at the closing ceremony by the actor Asia Argento. Argento named and shamed her alleged persecutor, the disgraced American film producer Harvey Weinstein.

Joining jury member Ava DuVernay on the stage at the Lumiere Theatre in the Palais du Festival, Argento said: “In 1997, I was raped by Harvey Weinstein here at Cannes. I was 21 years old. This festival was his hunting ground. I want to make a prediction: Harvey Weinstein will never be welcomed here ever again.

“He will live in disgrace, shunned by a film community that once embraced him and covered up for his crimes. And even tonight, sitting among you, there are those who still have to be held accountable for their conduct against women for behaviour that does not belong in this industry. You know who you are. But more importantly, we know who you are. And we’re not going to allow you to get away with it any longer.”

Weinstein denies all the allegations of non-consensual sex that have been made against him.

Asia Argento and Ava DuVernay at the closing ceremony. Photograph: Alberto Pizzoli/AFP/Getty Images

Blanchett said that choosing the winner for the 71st international film festival “was bloody difficult”. She added that her panel of judges had to put their own personal tastes aside at points to come to a joint decision. “We had to try to put our objective hats on,” said the Australian actor at the press conference that followed the announcement last night.

“There a lot of rules in France, surprisingly,” she joked. “And the Palme d’Or has to go to a film that brings lots of different things together. We felt that several films did that. It was quite painful but it [Shoplifters] is an extraordinary film.”

Fellow jury member Kristen Stewart, the American actor, said she had enjoyed her experience of sitting on the jury. “It was like the summer camp of my dreams. It was like a consolidated 10-day film school,” she said.

Last year the prize went to Ruben Ostlund’s The Square, a satire of the art world that went on to score an Oscar nomination for best foreign-language film.

Speaking on the red carpet ahead of the screening of his film, Gilliam said he had been working on the Quixote project for 28 years. It stars Jonathan Pryce, who joined Gilliam in Cannes, as the legendary Spanish deluded hero.

Full list of winners

Palme d’Or Shoplifters (dir: Hirokazu Kore-eda)

Grand prize BlacKkKlansman (dir: Spike Lee)

Jury Prize Capernaum (dir: Nadine Labaki)

Special Palme d’Or The Image Book (dir: Jean-Luc Godard)

Best actor Marcello Fonte, Dogman

Best director Pawel Pawlikowski, Cold War

Best screenplay Alice Rohrwacher (Happy As Lazzaro); Jafar Panahi and Nader Saeivar (Three Faces)

Best Actress Samal Yeslyamova (Ayka)

Caméra d’Or Girl (dir: Lukas Dhont)

Short Film Palme d’Or All These Creatures (dir: Charles Williams); special mention: On the Border (dir: Wei Shujun)