Senad Hadzic, 47, told the BBC that he spent several hours at the Syrian border haggling to get a visa.
Later he had to negotiate his way through numerous checkpoints - some manned by the army, others by rebels.
"Some of them even kissed the Koran I was carrying," he said, adding that he also had a Bible in his backpack.
The pilgrimage to Mecca is one of the five pillars of Islam - a duty that Muslims are expected to perform at least once in their lifetime.
Mr Hadzic set off from a town near the Bosnian capital Sarajevo and his first ordeal was to brave minus 35C cold in Bulgaria last December, says the BBC's Dan Damon.
"There wasn't a single easy day, every day has been difficult. But at the same time it's been exciting," he said.
Once he had got a Syrian visa, he said, an officer in President Bashar al-Assad's army "asked me to pray for him in Mecca, if I managed to get out of Syria alive".
"The road between the border, where I entered, and the city of Aleppo was full of huge stones. The rebels had thrown the stones to make it impossible for cars and buses to move. People with families simply had to get out of their cars."
He said having a Syrian visa "means nothing - a rebel fighter can walk out of a cornfield and demand your passport".
"No-one shot at me. I was stopped by armed people who inspected my passport. But when I said I was on the road to God, both the rebels and the army of President Assad let me continue."
Mr Hadzic said he carried both the Koran and the Bible "because I'm very religious".
"If I didn't believe that God was with me, the he was protecting me and guiding me, I wouldn't have even reached Bulgaria, let alone Mecca.
"I walked across seven countries, two deserts, 5,650 kilometres, without money, only with a rucksack weighing 20 kilograms," he told the World Update programme on BBC World Service.