Pope Francis during Angelus prayer in Cartagena, Colombia

CARTAGENA, Colombia (Reuters) - Pope Francis, his eye bandaged and blackened after a minor accident in the popemobile, wrapped up his trip to Colombia on Sunday appealing to the country to "untie the knots of violence" after a 50-year civil war.

His last day in the Andean country got off to a rocky start when he lost his balance and bumped his head while riding in the popemobile. He bruised his cheekbone and cut his left eyebrow, blood staining his white cassock.

The Vatican said he received ice treatment and was fine. A smiling pope continued the trip wearing a bandage over his cut. "I was punched. I'm fine," he joked afterward, the bruises on his face clearly visible.

At the end of the day, when he said Mass for hundreds of thousands of people in the city's port area, the bruise had swollen and he had a black bag under his eye.

"If Colombia wants a stable and lasting peace, it must urgently take a step in this direction, which is that of the common good, of equity, of justice, of respect for human nature and its demands," he said in a strong voice in the homily of the Mass.

"Only if we help to untie the knots of violence, will we unravel the complex threads of disagreements," he said.

Francis used the trip to urge Colombians deeply polarized by a peace plan to shun vengeance after a bloody 50-year civil war. He also said leaders had to enact laws to end injustice and social inequality that breeds violence.

Cartagena, a top tourist destination famous for its colonial walled ramparts, was the home to Saint Peter Claver, a Spanish priest who ministered to slaves in Colombia in the 1600s, defying Spanish colonial masters who treated them as chattel.

The pope used the occasion to again decry modern slavery and human trafficking and defend the rights of immigrants.

MILLIONS STILL IN SLAVERY

Human rights groups estimate that millions of people around the world are victims of human trafficking and forms of modern slavery such as forced labor and prostitution.

"Here in Colombia and in the world, millions of people are still being sold as slaves; they either beg for some expressions of humanity, moments of tenderness, or they flee by sea or land because they have lost everything, primarily their dignity and their rights," the pope said just before praying before Claver's relics.

Some 300 Afro-Colombians who receive assistance from the Jesuit religious order, of which the pope is a member, prayed with him in the church.

Francis visited the impoverished neighborhood of San Francisco and blessed the cornerstone of a shelter for at-risk Afro-Colombian girls vulnerable to child prostitution, drugs and violence.

Earlier in the day, the first Latin American pope said he was praying for the well-being of all countries on the continent but particularly Venezuela, which has been caught up in a social and economic crisis.

"I express my closeness to all the sons and daughters of that beloved nation, as well as to all those who have found a place of welcome here in Colombia," referring to the tens of thousands of Venezuelans who have crossed the border to find food and medicine.

"From this city, known as the seat of human rights, I appeal for the rejection of all violence in political life and for a solution to the current grave crisis, which affects everyone, particularly the poorest and most disadvantaged of society," he said.

National Human Rights Day is celebrated in Colombia on Sept. 9, in honor of Claver, who died in 1654.

Venezuela has been convulsed by months of near-daily protests against leftist President Nicolas Maduro, who critics say has plunged the oil-rich country into the worst economic crisis in its history and is turning it into a dictatorship.

World bodies and foreign governments have expressed concern about the shortage of food and medicine in Venezuela and called for political dialogue between Maduro and the opposition. Church leaders in Venezuela have made a series of highly critical speeches since late last year.