The spate of violence in Okene in central Nigeria began on Monday night, when gunmen stormed an evangelical church, cut the electricity and opened fire once the building was plunged into darkness, killing 19 people.
On Tuesday, assailants shot at troops patrolling outside a government building in Okene, sparking an exchange of gunfire that left two soldiers and two of the gunmen dead, the military and police said.
The government building is located near a mosque, but the commander of a military task force in the state, Lt. Col. Gabriel Olorunyomi, said worshippers observing evening Ramadan prayers were not the target.
"The curfew is imposed in all of Okene, from dusk to dawn," said Jacob Edi, spokesman for the state governor.
It was not clear who carried out the church killings or whether the two attacks were linked, although a police spokesman said there was "suspicion" that the same group was responsible for both assaults.
The police said it raided a suspected hideout of militants who carry out attacks in the state, arresting a key leader and two other suspects.
"Crack detectives investigating the case stormed a criminal hideout in Idare hills of Okene, suspected to be a safe haven for the hoodlums wreaking havoc in the state," national police spokesman Frank Mba said in a statement.
A shootout followed and the gang leader, identified as Yekini Isah, received a head injury. Isah and two others, one of them a woman, were arrested, Mba said.
Boko Haram, a radical group of Islamist insurgents, has repeatedly targeted Christians during Sunday worship as well as the security forces in a series of gun raids and suicide blasts.
A leading Christian body said the Okene massacre showed that the plight of Christians was worsening.
"The enemies of Christians and Christianity in Nigeria have changed their tactics from their Sunday attacks on churches to an everyday onslaught," the Christian Association of Nigeria said in a statement Wednesday.
Speaking to the Vatican's radio station on Tuesday, the Archbishop of Abuja, Monsignor John Onaiyekan, underscored that despite the Boko Haram violence, the overwhelming majority of Nigeria's Christians and Muslims co-exist peacefully.
"It is important for the worldwide Christian community to have a clearer idea of the situation in Nigeria: a large persecution of Christians by Muslims is not ongoing," he said in Italian.
He also said he believed the aim of the extremists was to foment chaos by pitting Christians against Muslims.
Nigeria, Africa's most populous nation and largest oil producer, is roughly divided between a mainly Muslim north and predominantly Christian south. Boko Haram has said it wants to create an Islamic state in the north.
The group has killed more than 1,400 people since 2010 in attacks across northern and central Nigeria, according to a new toll released Wednesday by Human Rights Watch.
The US State Department last month designated three of the group's leaders as global terrorists and the top American diplomat, Hillary Clinton, currently on an Africa tour, is expected in Abuja on Thursday for talks in which security concerns are likely to feature prominently.