An African epidemic of homophobia ACCRA, Ghana - On Thursday, my students and I visited a high school here in Ghana. When the headmistress told us that her students were "losing their culture" and "becoming too Western," we asked for an example. "Homosexuality," she said. To us, it is an abomination. It comes from elsewhere. That morning, coincidentally, President Obama was addressing the same issue at a news conference in Senegal. Asked about the U.S. Supreme Court's recent decisions in support of gay marriage, Obama acknowledged that Africans have "different customs" and "different traditions" about homosexuality. But he went on to insist that gays should have equal rights under the law, no matter where they live. Bloggers and news commentators across Africa reacted angrily to Obama's remarks, insisting that homosexuality and gay rights are Western imports. But they're wrong. And if you think otherwise, I've got two words for you: Nelson Mandela. VIDEO: While in Senegal, President Obama addressed gay rights Nobody on the continent has held more moral authority than Mandela, the first post-apartheid president of South Africa. From the beginning, Mandela spoke out for gay rights in South Africa, the only African country with a constitution protecting homosexuals from discrimination. Shortly after becoming president, Mandela appointed an openly gay judge to South Africa's High Court of Appeal. Other prominent gay rights supporters include Archbishop Desmond Tutu and Mandela's successor, Thabo Mbeki. According to Mbeki, the struggle against apartheid, which had banned interracial sex, made South Africa's new leaders reluctant to raid people's bedrooms. The South African examples speak loud and clear: Gay rights are human rights, not Western ones, so everyone is enjoined to respect them. VIDEO: A growing hunger - drought and conflict leave parts of africa in misery Too bad other African countries don't. In Senegal, for example, gay sex is punishable by up to eight years in prison; and in Tanzania, the final destination of Obama's trip, it carries a sentence of 30 years to life. Here in Ghana, meanwhile, a 2003 law makes "unnatural carnal knowledge" punishable by five to 25 years in jail. The issue flared in February after reports circulated that American author Andrew Solomon, who is gay, had given large campaign donations to Ghanaian President John Dramani Mahama to push "homosexualism" and "the gay rights agenda" here. Solomon had an endorsement blurb for Mahama's new memoir, but the rest of the tale was pure fiction. Nevertheless, Mahama was forced to make a statement confirming that he supports the continued criminalization of homosexuality. In nearby Nigeria, meanwhile, legislators recently approved a bill calling for a 10-year sentence for any public show of affection by a same-sex couple. And the rationale is the same: Homosexuality comes from the West, and Africans need to keep it out. Never mind the long history of same-sex love in Africa, which was widely practiced and accepted on the continent for thousands of years. Homosexuality wasn't banned until the age of colonization, when European powers and missionaries brought anti-gay attitudes and laws to Africa. After World War II, when African countries began to win their independence, many European and Western societies decriminalized gay sex. But the new African nations stepped up their campaigns against it, reinforcing one of the worst colonial legacies. And that's the sad historical irony here. To many Africans, homosexuality and gay rights come from the West. But the West's truly awful gift to the continent was homophobia, which the Africans then adopted as their own. "Prez Obama I love you and all," one Ghanaian blogger wrote last week, after Obama's comments in Senegal, "but don't force America's wayward behavior on Africa. We may be poor and not developed, but at least we have our customs and traditions. But nobody is "forcing" homosexuality on Africa, where it has existed for much longer than many Africans want to admit. Customs and traditions banning gay love are more recent. And as Mandela understood, they can be changed. Let's hope that other Africans find the courage to follow his example. Jonathan Zimmerman, a professor of education and history at New York University, is teaching in NYU's study abroad program in Ghana this summer. He is the author of "Small Wonder: The Little Red Schoolhouse in History and Memory."