A video has been released by the Cuban government showing the meeting between Pope Francis and the country's revolutionary leader Fidel Castro, the first by the current pope to the communist-ruled island.

The two met on 20 September after the current pontiff celebrated Mass in Havana's Revolution Square. The two spoke about religion and world affairs at the home of the 89-year-old retired president for about 40 minutes. Castro's wife, Dalia Soto del Valle, was also present for the private meeting.

Vatican spokesman Father Federico Lombardi said the meeting, which included other Castro family members, was "very relaxed, fraternal and friendly".

Francis gave Castro several of his official papal writings, two books on spirituality and a book and CD on the writings of Father Armando Llorente, a priest who taught Castro in Jesuit prep school more than 70 years ago.

Castro gave him a copy of Fidel and Religion, a 1985 book of interviews with a Brazilian priest which lifted a taboo on speaking about religion in Cuba, then officially atheist.

Pope Francis, Havana
Thousands lined the streets of Havana to catch a glimpse of Pope Francis, the first Latin American pontiffReuters

Francis met Castro, who built a one-party state that improved health and education services for Cubans but also limits democratic freedoms and represses dissent.

There, he spoke beneath massive portraits of revolutionary leaders Ernesto "Che" Guevara and Camilo Cienfuegos built into the facades of state buildings. To welcome the pope, who helped bring about the recent rapprochement between Cuba and the US, a similarly giant poster of Jesus Christ was hung nearby.

Francis delivered a mostly religious homily to the tens of thousands present, but sprinkled it with criticism of "elitism" and ideology. Francis also exhorted Cuba and the US to deepen their detente, and encouraged Cuba to grant more freedom to the Roman Catholic Church, which has re-emerged as a powerful force after suffering decades of repression.

Many Cubans appreciate the pope for his role in the secret talks that led to last December's breakthrough with Washington, when Castro and US President Barack Obama vowed to normalise relations and end a half century of animosity.

Francis will fly from Cuba to Washington on 22 September where he will meet with Obama and address both the US Congress and United Nations.