The ceremony was moved indoors at the last minute because of a sudden rain storm.
The Vatican repeatedly has criticized the U.S. embargo as a measure that has not forced Cuba's communist government to respect human rights, but instead has had a devastating effect on the Cuban people, especially the poor.
The Pope said that peaceful coexistence requires individuals and nations to "reject immovable positions and unilateral viewpoints, which tend to make understanding more difficulty and efforts at cooperation ineffective."
"Patience and sincere dialogue" are necessary, he said.
Before departing from Havana's Jose Marti International Airport for his return flight to Rome, Pope Benedict told government officials and the Cuban public that he was convinced that, wherever Jesus Christ is present, "discouragement yields to hope, goodness dispels uncertainties and a powerful force opens up the horizon to beneficial and unexpected possibilities."
He said he hoped his presence in Cuba would strengthen those who "with perseverance and self-sacrifice" carry out the work of evangelization.
VIEW ALL STORIES FROM THE POPE'S VISIT TO LATIN AMERICA
VIEW MORE PHOTOS FROM THE TRIP ON FACEBOOK
And he said he hoped no Cuban would feel excluded from taking up the "exciting search for his or her basic freedoms" or feel excused from the challenge because they lack energy or resources.
While the Pope said his message was motivated by faith and the desire to share it, he insisted that societies themselves are better off when people are free to profess their faith and when faith-based schools and social services are allowed to operate.
He prayed that the light of faith would shine on Cuba, helping people "to foster social harmony and to allow the blossoming of all that is finest in the Cuban soul, its most noble values, which can be the basis for building a society of broad vision, renewed and reconciled."
Several miles of the main road leading to the airport were lined with crowds several people deep. A few waved Vatican or Cuban flags, but they did not demonstrate the wild enthusiasm shown for the pope's motorcade in Mexico just a few days earlier. Civilians with their backs to the road provided crowd control as the Pope passed by in the popemobile and it began to rain.
Although the pope's stay in Cuba was drawing to an end, he said he would continue praying that the country would make progress in becoming a place "where justice and solidarity coexist in a climate of serene fraternity."
"Respect and promotion of freedom, which is present in the heart of each person, are essential in order to respond adequately to the fundamental demands of his or her dignity and, in this way, to build up a society in which all are indispensable actors" in the future of their own lives, that of their families and of Cuba itself, he said.