Police in Indonesia shot a sword-wielding man who attacked a church congregation during Sunday Mass, injuring four people, including a German priest.

The reason for the attack Sunday morning in Sleman district in Yogyakarta province was not immediately clear. The 22-year-old attacker decapitated statues of Jesus Christ and the Virgin Mary during the incident, photos showed.

Churches are a common target for Islamic militants in Indonesia, the world's most populous Muslim nation.

Local police detective Fendi Timur said counterterrorism police would be involved in the investigation.

Video shows people in the church throwing books at the man as he lunged toward them with his sword. Witnesses and police said the injured included a police officer who tried to subdue the attacker and the 81-year-old priest Karl Edmund Prier, a longtime resident of Indonesia.

They suffered back, neck and head wounds and are in stable condition.

The suspect, identified only as Suliyono, was hospitalized.

Yos Bintoro, a priest from the attacked St. Lidwina Church, said it condemns the assault but urged people not to overreact online.

"We oppose any movement that denies the diversity and the unity of our nation," he said.