On Sunday, gunmen with explosives attacked a Catholic church in southwest Nigeria and opened fire, killing "dozens" of worshippers and injuring others, the government and police said.

The violence broke out during a morning service at St. Francis Catholic Church in Owo, Ondo State, in an unusual attack in the southwest of Nigeria, where jihadists and criminal gangs operate in other areas.

The grounds for the attack and the actual number of people killed were unknown at the time, but President Muhammadu Buhari decried the "heinous massacre of worshippers."

Ibukun Odunlami, a state police spokesperson, said the attackers also used explosives to attack the church, killing an unknown number of worshippers.

"It is still too early to estimate how many individuals were lost. However, several worshippers were killed, and others were injured, in the incident," AFP quoted her as saying.

In a statement, Pope Francis said he had learnt of the "death of dozens of faithful," many of whom were youngsters, on the Christian holiday of Pentecost.

"While the incident's specifics are being worked out, Francis prays for the victims and the country," he stated.

For the time being, a spokesman for the governor of Ondo State indicated they would not be providing an official casualty figure.

However, a witness identified as Abayomi told AFP that at least 20 worshippers were killed in the attack.

"I was passing through the area when I heard a tremendous explosion inside the church and gunfire," he added.

He claimed he spotted at least five gunmen on the church grounds before fleeing for his life.

Ondo state governor Oluwarotimi Oluwarotimi Akeredolu described the incident as "vile and diabolical" and urged security officials to apprehend the perpetrators.

The incident comes only one day before the ruling APC party begins primary elections for its candidate in the 2023 race to succeed Buhari, a former army leader who is stepping down after two terms in government.

Regardless of who wins the campaign to lead Africa's most populous country and greatest economy, security will remain a major concern.

In Ondo state and other parts of the southwest, gun and bomb attacks are uncommon, but Nigeria's military is fighting a 12-year-old Islamic insurgency in the northeast, as well as gangs in the northwest and separatist movement in the southeast.

Heavily armed gangs have been raiding towns and targeting communities and schools for mass kidnapping attacks in parts of northwest and north-central Nigeria in particular.