Gunmen attacked a Catholic church in southwest Nigeria during mass on Sunday, killing at least 50 people including women and children, according to a hospital doctor and media reports, Reuters reported.

The gunmen shot at people outside and inside the church building, killing and injuring worshippers, said Funmilayo Ibukun Odunlami, police spokesperson for Ondo state.

She did not say how many people were killed or injured at St Francis Catholic Church in the town of Owo, but added police were investigating the cause of the attack.

A doctor at a hospital in Owo told Reuters that at least 50 bodies had been brought into two hospitals in the town from the attack.

Nigerian President Muhammadu Buhari condemned the attack, calling it "heinous."

The identity and motive of the attackers was not immediately clear.