Indonesian authorities detained a woman carrying a gun outside the presidential palace in Jakarta, though the country's leader was not there at the time and there were no injuries, officials said.
The incident had happened at about 7am local time (8am Malaysian time), said a presidential official, Ali Mochtar Ngabalin.
Ali said that the woman had not entered the palace compound and that President Joko Widodo was not present.
She was wearing a niqab, or the full-face Islamic veil, and was carrying the Quran, Ali said.
The woman who he said appeared to be in her 20s had been apprehended by security officers after brandishing the gun near the palace, he added.
A spokesperson for the Jakarta police said the woman was now being questioned, but it was not immediately clear what her motive was or how she had obtained the weapon.
Indonesia, which is the world's biggest Muslim-majority country, has previously suffered attacks carried out by Islamic militants, sometimes targeting government officials and security forces.
Police shot dead a woman who had opened fire on officers at the national police headquarters in Jakarta last year in an attack inspired by the Islamic State.
- Reuters