A Colombian court has issued the country's first conviction under a racial harassment law after a local official likened black and indigenous people to a "cancer", prosecutors said.

Councilman Fernando Antonio Delgado made the inflammatory remarks during an August 2012 meeting and was the first person to be convicted under a 2011 anti-discrimination law, according to prosecutors.

"Black people, displaced people and indigenous people are a cancer affecting national and global governance," the official, from the town of Marsella in the western Risaralda department, had said.

Colombia is home to a diverse mix of ethnic groups, but Afro-Colombians and indigenous people have long suffered significant discrimination.

Mr Delgado now faces possible jail time of between 12 and 36 months, though this could be set even higher because he is a public official. He also faces the prospect of being stripped of his office.

Speaking to a radio station following the verdict, Mr Delgado apologised and said he would appeal.

"I explained that I didn't mean to say those words", he said.

Various community members welcomed the ruling.  Jorge Enrique Machado, a representative for local indigenous people, said it "refutes the arguments of those who were saying this was only an opinion".

Of Colombia's 47 million people, 10.6% are black and 3.4% are indigenous.