Germany's Federal Prosecutors Office said in a statement Thursday the man, identified only as Mhamed J., gathered photos and other intelligence on members of the Polisario Front independence movement between October 2009 and October 2010.
Prosecutors have charged the Moroccan with spying for a foreign agency and reporting the activities of exiled opposition members. The statement gave no further details. Prosecutors could not immediately be reached for comment.
Morocco says Western Sahara is part of its kingdom but has been locked for decades in a dispute with a the Polisario Front over claims to the territory.
Africa's last colony
Since 1975, three quarters of the Western Sahara territory has been illegally occupied by Morocco. The original population lives divided between those suffering human rights abuses under the Moroccan occupation and those living in exile in Algerian refugee camps. For more than 40 years, the Saharawi await the fulfilment of their legitimate right to self-determination.