A man carrying a bomb and an axe attacked a Catholic priest in Indonesia during a Sunday service at St Yoseph Church in North Sumatra.

The bomb failed to explode and burst into flames burning the man's back, after which he pulled an axe from his bag and ran towards the priest. He slashed the priest's arm, who only sustained a minor injury. The man was then subdued by the congregants who took his axe, and held him until the arrival of police.

Reverend Albert Pandiangan, 60, was later taken to a nearby hospital for check-up.

The police said that the items he was carrying had an Islamic State insignia which appeared to be a hand-drawn ISIS flag.

A bomb squad was also called in to examine the attacker, an 18-year-old man, for any other explosives he might be carrying.

"A terrorism act was carried out on Sunday morning at the Saint Joseph Catholic church," Medan police spokeswoman, Rina Sari Ginting, said in a statement. "Police are interrogating the perpetrator... and will search his house for any bomb-making materials."

The family of the attacker told The Jakarta Post that there was a change in his attitude during the last two months. He refused to greet his Christian grandmother without wearing gloves during Idul Fitri. It is an Indonesian tradition to kiss hands of the elderly to show respect. The attacker had also recently argued with his older brother over aqidah (Islamic creed), and had received a fertilizer pack from an unknown person a week before the attack.

A woman identified as Vero told The Jakarta Post that the man was sitting besides her at the Sunday Mass. She said that he was at unease during the service.

"He was fidgety the whole time. He also could not follow our ritual," she said.

Vero also said that he took some cables out and connected them which caused a small explosion.

Another church member Randa told JP that when the perpetrator was detained, two other unidentified people ran away from the church.

"We never saw them," she recounted.

An eyewitness, Markus Harianto Manullan, told AFP/AP that he was wearing a jacket and appeared to have something in his pocket.

"He sat in the same row as I did... I saw him fiddling with something in his jacket, and then I heard a small explosion and he immediately ran to the podium," Manullan said.

Even after the attack, people did not move away from the premises but continued to congregate in groups outside the church amid heavy security.