CNN Portugal said the alleged author of the attack, an Afghan national who wielded a large knife, had been shot and detained.

Portuguese police did not immediately confirm the nationality of the suspected author of the attack.

Prime Minister Antonio Costa said everything indicates that it was "an isolated act", adding it was "premature" to make any interpretation about the crime.

Ismailis are a minority current within Shi'ite Islam whose members have been attacked by extremist groups in countries such as Pakistan.

(Reporting by Catarina Demony and Patricia Rua, writing by Andrei Khalip, editing by Inti Landauro)