Pope Francis flies to eastern Cuba on Monday for the next leg of his pilgrimage after having met with both Raul and Fidel Castro but missing out on an encounter with Cuban dissidents.

The Vatican stressed that no official meeting had been planned with the dissidents. The Vatican embassy in Havana did make calls to some leaders "as a sign of attention to these people," the Vatican spokesman said, but in the end the dissidents were prevented from reaching the cathedral where the greeting was planned.

The Castro meetings went off without a hitch.

The Vatican described the 40-minute session with Fidel Castro at the former president's home as "informal and familial," with an exchange of books and discussion about big issues facing humanity, including Francis' recent encyclical on the environment and the global economic system.

Video of the encounter broadcast on Cuban state media showed the 89-year-old Castro chatting animatedly with Francis and shaking the pope's hand, the pope standing in his white vestments and Castro sitting in a white button-down shirt and Adidas sweat top.

The meeting brought together the leader who shaped Cuba for the last half of the 20th century and Latin America's first pope, who is credited by many Cubans with opening a path to the future by mediating the warming diplomatic relations between their country and the United States. After his Cuba visit, the pope flies to Washington for his first ever trip to the U.S.

Francis called on Castro after celebrating Mass in Havana's main plaza on his first full day in Cuba.

In his homily delivered under the gaze of a metal portrait of revolutionary fighter Che Guevara, Francis urged Cubans to care for one another out of a sense of service, not ideology. He encouraged them to refrain from judging each other by "looking to one side or the other to see what our neighbor is doing or not doing."

"Whoever wishes to be great must serve others, not be served by others," he said. "Service is never ideological, for we do not serve ideas, we serve people."

It was a subtle jab at the communist system, which even the Vatican spokesman didn't deny. "The pope doesn't tend to make explicitly political speeches, but he has some general principles and everyone is free apply their different experiences of life on them," the Rev. Federico Lombardi said.

Many Cubans complain about the rigidity of the Cuban system in which nearly every aspect of life is controlled by the government, from cultural institutions to block-level neighborhood watch committees. While the system has softened in recent years, Cubans can be excluded or lose benefits if they are perceived as being disloyal to the revolution.

Cubans are also increasingly concerned about growing inequality, in which those with access to foreign capital live lives of relative luxury while others can barely feed themselves, generating jealousy and division.

"Being a Christian entails promoting the dignity of our brothers and sisters, fighting for it, living for it," Francis told the crowd.

At one point, Francis was approached by a man who grabbed onto the popemobile and appeared to be speaking emotionally to the pontiff, who touched him on his hand and head before he was pulled away by security agents. Video showed what appeared to be the same man throwing leaflets in the air, and backers of a Cuban dissident group said on Twitter he was a member of the opposition.

The head of the opposition group Ladies in White said 22 of 24 members of her group who wanted to attend Mass were prevented from going by Cuban security agents. And two other well-known Cuban dissidents said agents detained them after the Vatican invited them to the pope's vespers service at Havana's cathedral.

Marta Beatriz Roque and Miriam Leiva said they received invitations from the office of the papal ambassador in Havana but said they were arrested as they tried to travel to the cathedral.

"They told me that I didn't have a credential and that I couldn't go to the pope's event that was taking place there in the Plaza of the Cathedral," Roque said.

Lombardi, the Vatican spokesman, said that some dissidents were invited to events to receive a greeting from the pope but that he didn't know why the greeting didn't take place.

Francis met for an hour with Fidel's brother Raul, a declared atheist who, perhaps jokingly, has said he likes the pope so much he is thinking of returning to his Catholic roots. Francis thanked the 84-year-old leader for his pardon of thousands of petty criminals before his arrival. Castro presented the pontiff with a huge sculpture of the crucified Christ made of oars by the artist Kcho and a painting of the Virgin of Charity of Cobre, Cuba's patron saint.

Francis is due to visit the shrine to the virgin near the eastern city of Santiago on Monday evening, after making a brief stop in the city of Holguin for a Mass.

___

Associated Press writers E. Eduardo Castillo and Anne-Marie Garcia in Havana and Christine Armario and Andrea Rodriguez in Holguin, Cuba, contributed to this report.

___

Nicole Winfield on Twitter: https://twitter.com/nwinfield

Michael Weissenstein on Twitter: https://twitter.com/mweissenstein