More than 50 artists from some 10 countries performed in the show which lasted more than two hours.
Havana was chosen as the 2017 global host city of the concert, which was launched in 2012 with support from the United Nations Educational, Scientific and Cultural Organization (UNESCO) and the Thelonious Monk Institute of Jazz.
More than 50 artists from some 10 countries performed in the show, which opened with "Manteca" -- a foundational song of Afro-Cuban jazz co-written by Cuban percussionist Chano Pozo and American trumpeter Dizzy Gillespie.
"Afro-Cuban jazz and its rich history have played a pivotal role in the evolution and enrichment of the entire jazz genre," said Hancock, an UNESCO goodwill ambassador for intercultural dialogue.
Since Cuba's historic rapprochement with the United States began some two years ago US visitors have flocked to the island and American stars have become a more regular presence.
Among the audience was Miguel Diaz-Canel, Cuba's vice president of the State Council. He is rumored to be among the possible successors to President Raul Castro, who will step aside in February 2018.
The show -- which has been held in past years in New York, Istanbul, Osaka, Paris and Washington -- lasted more than two hours and closed with John Lennon's "Imagine."
"This year's focus on Cuba is testament to the power of jazz to build bridges and join women and men together around shared values and aspirations," said UNESCO director-general Irina Bokova.
"The story of jazz is written into the quest for human dignity, democracy and civil rights. Its rhythms and variety have given strength to the struggle against all forms of discrimination and racism -- this is the message we must take across the world today."
For last year's concert Barack Obama dubbed the White House the "Blues House," with stars including Hancock, Dee Bridgewater, Aretha Franklin and Hugh Masekela joining the then-president on the South Lawn.