Sixty-three-year old John Ross Macleod was arrested Saturday at Ghana's airport after police who were searching him for drugs turned up a compact disc with pictures of Macleod having sex with another man, said Charles Darkwa, a police spokesman.
Homosexual acts and sodomy have long been illegal in the West African country, though prosecution not common.
Macleod and the Ghanaian man in the pictures, 19-year-old Emmanuel Adda, pleaded guilty Monday to "unnatural carnal knowledge." Macleod pleaded not guilty to a separate charge with possessing obscene pictures, Darkwa said.
Macleod first met Adda, a recent high school graduate, through the Internet and they had exchanged a number of e-mails before the photographer arrived in Ghana in early October to visit Adda, Darkwa said.
"During his stay in Ghana, Adda traveled round the country with Macleod, who took the opportunity to sodomize him and took pictures as well," Darkwa said.
Neither of the men nor their lawyers were immediately available to comment.
Court officials said this was the first sodomy case in Accra's courts this year, but said they did not have records on the last time such charges were brought.
Homosexuality is illegal in many African countries, including Kenya, Senegal, Nigeria, Uganda, Mauritania and Sudan. South Africa prompted continentwide controversy last year when it became the first African country to legalize gay marriage.