A foreign citizen, who planned to commit a terrorist attack on the territory of Azerbaijan, has been detained, Olaylar reports.