Around 100 people were attending the mass at the church in Sleman town, Yogyakarta province when a man barged in wielding a one-metre-long sword and began attacking people seemingly indiscriminately.
"Four people have been injured in the incident -- quite seriously -- but we still cannot determine the perpetrator's motive," Yogyakarta police spokesman Yulianto told AFP.
A congregation member Andhi Cahyo said a few minutes after the mass started, a congregation member barged into the church with a bleeding head. A young man holding a sharp weapon was chasing him.
"Everybody started panicking and screaming, I was scrambling to save my wife and children," Cahyo told AFP.
People in the church ran out through another door and the assailant pursued them while also destroying church property.
He also attacked a priest who was standing at the altar.
"After the warning shot was fired, the attacked charged towards the officer with his sword. The officer then shot him below his stomach, but he managed to injure the cop before being subdued," Cahyo said.
All victims have been taken to Panti Rapih hospital for treatment.
The incident was the latest attack in the world's most populous Muslim-majority country against a minority group in Indonesia, which is home to significant numbers of Christians, Hindus and Buddhists.
In 2016 several children were injured after a man allegedly threw Molotov cocktails at a church during a Sunday service.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)