About 100 people were at St Lidwina Church in Sleman, Yogyakarta province, when a man wielding a metre-long blade burst in and began lashing out at worshippers.
A police spokesman said: “Four people have been injured in the incident – quite seriously – but we still cannot determine the perpetrator’s motive.”
Worshipper Andhi Cahyo said a few minutes after the service started, a congregation member ran in with a bleeding head while he was chased by a young man holding a sharp weapon.
He said: “Everybody started panicking and screaming. I was scrambling to save my wife and children.”
As the attacker slashed Christian imagery and a number of books and damaged a Virgin Mary statue, people used another door to escape.
Police arrived soon after the attack and fired a warning shot but the attacker refused to surrender.
The man was shot and wounded by police and taken to hospital following the attack on the island of Java.
The police spokesman said: “After the warning shot was fired, the attacker 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.”
All the victims have been taken to hospital for treatment.
Police said the man was a university student in his early 20s but could not confirm if the incident was terror-related.
The man is undergoing treatment at Bhayangkara Hospital and has yet to be questioned by police.
Extremists have carried out a series of attacks against Christians and other minorities in the mainly Muslim country.
More from Indonesia
Indonesia navy seizes ton of crystal meth on ‘phantom ship’
Blaze rips through historical collections at Jakarta’s maritime museum
Jakarta stock exchange: Nearly 80 people injured as ceiling collapses
Indonesia hit by second fatal boat capsizing in days
US prisoner recaptured after five-day manhunt in Bali
Strong earthquake strikes Indonesia’s main island, killing three people
Several children were injured after a man threw Molotov cocktails at a church during a Sunday service in 2016.
On Christmas Eve 2000 the al Qaeda-linked Jemaah Islamiyah group carried out coordinated bombings of churches in Jakarta and eight other cities which killed 18 people and injured scores of others.