He was speaking to Muslims who had sought shelter in the capital Bangui after nearly three years of violence between Christians and Muslims.
The mosque visit was seen as perhaps the most difficult part of his Africa tour, according to the BBC.
On Sunday, the Pope called on fighting factions in the CAR to lay down their weapons.
Celebrating Mass in Bangui, he said they should instead arm themselves "with justice, love, mercy and authentic peace".