BAGHDAD — Jalal Dhiyab Thijeel was tall, funny and handsome, qualities that should have made him a popular man in Basra, Iraq, where he lived. But he was also black, one of hundreds of thousands of Iraqis who have been pushed to the margins of society based on their skin color.

In 2003, inspired by the opening of Iraqi society after the American invasion and, later, by the success of Barack Obama in overcoming his own country’s history of racism, Jalal began to push for anti-discrimination laws in Iraq. For his audacity, Jalal was assassinated last year in Basra.

Most estimates show there are about 400,000 Iraqis who trace their origins back to sub-Saharan Africa, most of them living in the south around Basra, though a few push the count as high as two million. There are few written accounts of their early history in the country, though what records do exist show that the first of them arrived in what is now Iraq as slaves as early as the seventh century.

Just as blacks did much later in the United States, blacks in Mesopotamia worked in wealthy homes and in backbreaking agricultural work, including clearing marshland. A series of slave uprisings rocked the region from 869 to 883, but were eventually quelled.