Pope Francis on Wednesday voiced support for same-sex couples, calling them “children of God” and saying they should be allowed to have legally recognised civil unions, in a radical shift from previous pontiffs.

The pope, whose opposition to gay marriage remains unchanged, said in a documentary premiered at the Rome Film Festival: “These are children of God, they have the right to a family.

“What we have to create is a law of civil union, they have the right to be legally protected. I have defended that,” he said in film-maker Evgeny Afineevsky’s “Francesco”.

According to biographer Austen Ivereigh, the future pope backed civil unions for gay couples while he was still the archbishop of Buenos Aires and known as Jorge Bergoglio.

But while Francis has previously spoken about same-sex unions, he has always voiced opposition to gay marriage, saying that marriage should only be between a man and woman.

“’Marriage’ is a historic word,” he told French sociologist Dominique Wolton in a 2017 book of interviews.

“Always among human beings, and not only in the Church, it has been between a man and a woman. You can’t just change that like that.”

Vatican expert Vania de Luca told RaiNews: “Since the beginning of the pontificate the Pope has spoken of respect for homosexuals and has been against their discrimination.

“The novelty today is that he defends as Pope a law for civil unions.”

After becoming pope in 2013, Francis took an unprecedented welcoming tone towards LGBTQ individuals, launching his famous phrase, “Who am I to judge?” and welcoming gay couples to the Vatican on several occasions.

The two-hour documentary screened on Wednesday traces the seven years of his pontificate and his travels.

Among the most moving moments of the film is the Pope’s phone call to a gay couple, parents of three young children, in response to a letter they sent him saying how ashamed they were to bring their children to their parish.

Francis invites them to continue to go to church regardless of the judgements of others.

In the past, he has regularly said gay people should be accepted in their parishes and urged parents not to reject their children.

And on his first foreign trip as pope, to Brazil in 2013, he asked “who am I to judge?” about members of the LGBTQ community.

He has since received many gay people for private audiences, infuriating the Church’s more conservative wing.

Chilean Juan Carlos Cruz, an activist against sexual abuse within the Church, accompanied the director to the film screening on Wednesday.

“When I met Pope Francis he told me he was very sorry about what happened. ‘Juan, it is God who made you gay and he loves you anyway. God loves you and the Pope loves you too,’” Cruz recalled in the film.