Mozambique's President Filipe Nyusi announced during a trip to Vatican City that the Pope planned on visiting the southern African country next year, to which the Pope replied: "if I am still alive", local media reports.
Their gag-filled meeting lasted 30 minutes.
According to the Catholic News Service's Rome correspondent, Junno Arocho Esteves, the Pope cracked a joke with Mr Nyusi, asking the Mozambican leader: "Do you know the difference between protocol and terrorism?".
"[I] was ushered away before hearing the punchline, but the answer is, 'You can negotiate with a terrorist,'" Mr Esteves said.
The two men also discussed relations between Vatican City and Mozambique.
"During the cordial discussions, the good relations between the Holy See and Mozambique and the valued contribution of the Catholic Church in several sectors of society were underlined, with reference to the Bilateral Agreement signed in 2011 to facilitate the activity of the Church in the country" the Vatican wrote in a press release.