Priest Albert Pandiangan was holding a mass at Saint Joseph Catholic Church in the city of Medan on the western island of Sumatra when a young man approached him and stabbed him in his left arm, said local chief detective Nur Fallah.
The attacker was carrying a homemade explosive device, said Fallah.
"Somebody tried to kill the priest by pretending to attend the church service and at that time tried to explode something, like a firecracker, but the firecracker didn't explode, it only fumed," Fallah told reporters.
The priest suffered slight injuries and has been taken to hospital for treatment.
A picture of the attacker's ID card circulating online said he was Muslim.
In recent years there have been a number of attacks on religious minorities and others in Indonesia, the world's most populous Muslim-majority country.
A suicide attack in the Indonesian capital in January killed four attackers and four civilians, including a Westerner, and injured 19.
In July a suicide bomber linked to the Islamic State group blew himself up outside a police station in Central Java.
Churchgoers on Sunday quickly caught the attacker and called the police.
An eyewitness, Markus Harianto Manullan, said the assailant wore a jacket and carried a bag.
"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.
Police are still investigating the man's motive.
Indonesian policemen guard a blindfolded suspect who attacked a priest in Medan. AFP
A knife-wielding man stabbed a Catholic priest and tried to set off an explosive device at a church in Indonesia on Sunday, police said, the latest attack on religious minorities in the mainly Muslim country.