A photo showing African asylum seekers stuck on a razor wire fence, behind white-clad golfers teeing off on an immaculately manicured golf course, has gone viral.

melilla fence golf course
A golfer hits a tee shot as African migrants sit on top of a border fence between Morocco and Spain's north African enclave of Melilla, on October 22, 2014 José Palazon/Reuters

The scene was captured by José Palazón, from the migrants' rights group Pro.De.In Melilla, who told El País: "It seemed like a good moment to take a photo that was a bit more symbolic. The photo reflects the situation really well – the differences that exist here and all the ugliness that is happening here."

Thousands of African immigrants living illegally in Morocco try to enter Spain's enclaves of Melilla and Ceuta each year, hoping to reach Europe.

Spain's Interior Ministry said 2,000 migrants have made it across Melilla's border fences in roughly 60 attempts this year. Those that make it head for the city's temporary migrant accommodation centre. They are eventually repatriated or let go.

Melilla is a tiny Spanish enclave on the northern coast of Morocco. The Moroccan authorities see it as an occupied territory and have called for its return to Morocco, likening it to Gibraltar.

Three 6m-high razor wire fences run for 11km along the disputed border, with regular watchposts and a road running between them.