Amazon has said it will donate to refugees in Germany the profits from online purchases of a track released by the far-right anti-migrant Pegida movement.

The online retailer had been criticised for making money from sales of the instrumental song Gemeinsam sind wir stark – German for “Together we are strong” – which was released over Christmas.

Pegida – Patriotic Europeans Against the Islamisation of the Occident – had said profits from the sale would be given to homeless Germans.

But Amazon placed a message on its German site saying profits it made on sales of the song would be donated to help hundreds of thousands of migrants, many fleeing the Syrian civil war, who have arrived in Germany over the last year.

“Amazon’s profits from the sale of this song will go to a non-profit-making organisation supporting refugees,” the company said.

Pegida started life over a year ago as a xenophobic Facebook group, initially drawing just a few hundred protesters to demonstrations in Dresden. The movement has survived a furore over a photograph of founder Lutz Bachmann sporting a Hitler hairstyle and moustache that went viral.