Quebec director Xavier Dolan has won the Grand Prix at the 69th Cannes Film Festival for his film Juste la fin du monde. The prize is second only to the coveted Palme d'Or, which went to British filmmaker Ken Loach for I, Daniel Blake.

The film features performances by Vincent Cassel, Marion Cotillard and Léa Seydoux. It is based on a play by Jean-Luc Lagarce about a man who returns home after a long absence, only to tell his family that he is about to die.

Cérémonie de Clôture/Awards Ceremony <a href="https://twitter.com/hashtag/Cannes2016?src=hash">#Cannes2016</a> <a href="https://t.co/wSyCzhfxBh">pic.twitter.com/wSyCzhfxBh</a> —@Festival_Cannes

A surprise win

Juste la fin du monde (It's only the end of the world) is the 27-year-old's sixth film and was considered a long shot for awards and accolades.

Juste la fin du monde received a lukewarm reception from both audiences and critics when it premiered last week. Vanity Fair's critic called it "the most disappointing film at Cannes."

Xavier Dolan’s 'It’s Only the End of the World' is the most disappointing film at Cannes <a href="https://t.co/f40npIl938">https://t.co/f40npIl938</a> <a href="https://t.co/JQDywUgpa0">pic.twitter.com/JQDywUgpa0</a> —@VanityFair

But along with Sunday's Grand Prix, Dolan's film also won the prize of Ecumenical Jury on Saturday, for its "human qualities that deal with the spiritual dimension."

Prime Minister Justin Trudeau publicly congratulated Dolan on Twitter following the win.

Director <a href="https://twitter.com/XDolan">@xdolan</a>’s "It's Only the End of the World" has won the Grand Prix at the Cannes film festival. You’ve made us proud again, Xavier. —@JustinTrudeau

Juste la fin du monde opens Sept. 21 in Quebec.

Previous success at Cannes

In 2014 Dolan's film Mommy shared the jury prize with French filmmaker Jean-Luc Godard.

Xavier Dolan arriving for the awards ceremony at the 67th Cannes international film festival in 2014 where his film Mommy was honoured. (The Associated Press)

The film had been a serious contender for the Palme d'Or, which went to the Turkish drama Winter Sleep.

Dolan has long been a Cannes darling. His first foray into the French film festival was in 2009 with his directorial debut, I Killed My Mother, which he wrote when he was only 17. The film picked up three awards: the Art Cinema Award, the SACD prize and the Regards jeunes prize.