Some 25 Islamic militants have been killed in an offensive near the city of Kano in Nigeria's north, the army says.
Twelve policemen and a civilian were killed in the Kano attack
Militants held an area after attacking a police station on Tuesday. Nine Islamists have been captured, as well as a quantity of arms, the army says.
Police say the militants came to avenge the assassination of a radical Islamic cleric shot dead last Friday.
The unrest adds to rising tension, with opposition parties threatening to boycott Saturday's presidential polls.
It is unclear how many militants are still at large.
In a statement on Tuesday night, 18 of the main parties demanded that the elections on Saturday be delayed and threatened a boycott unless several conditions were met.
"We don't know the people. We don't even know where they came from," a Kano man told the BBC.
Their demands include the annulment of last weekend's state polls described by the opposition as a "sham", and the disbanding of the Independent National Electoral Commission (Inec).
However, Inec lawyer Joe-Kyari Gagzama said the election could not legally be delayed after a high court ruling two weeks ago.
"There's no appeal against that judgement."
He also said the tenure of most of those in office is expiring on 29 May and he said Nigerians would be better focusing on security and other pressing issues rather than the polls.
The BBC's Alex Last in Panshekara where Islamists, known as the Taleban, hold an area of the town, says heavy shooting started at dawn and residents began fleeing.
The army cordoned off the area and engaged heavily armed Islamic militants holed up near the nearby waterworks.
The militants arrived in the area on Tuesday and attacked a police station killing 13 people.
Police and residents say they number up to 300, including women and children.
Our correspondent says it is very rare for this kind of attack to take place in northern Nigeria, but it is not unprecedented.
A few years ago, radical students from a university in north-eastern Nigeria took to the bush, called themselves the Taleban and attacked several police stations.
In the end, many were killed by the army.
But the fact is whoever these militants are, this incident just adds to the feeling of insecurity in a country already wracked by political turmoil over disputed elections, our reporter says.
The opposition parties called for a postponement of Saturday's presidential elections after lengthy talks in the capital, Abuja.
President Obasanjo is standing down after two terms
In the statement, they demanded the "total voiding" of the 14 April state elections and the complete disbandment and reconstitution of Inec.
Nigeria's governing People's Democratic Party (PDP) has won 26 of the 33 states declared so far.
The opposition parties also urged Nigerians to "protest in a non-violent manner these sham elections so far held, and to resist further elections under the current structure".
The opposition said the electoral commission was under the control of outgoing President Olusegun Obasanjo.
The opposition coalition includes Vice-President Atiku Abubakar and former military head of state Muhammadu Buhari.
They are regarded as the main challengers to Umaru Yar'Adua - the governing party's presidential candidate.
Apart from attempting to discredit the elections, many observers question what the opposition would achieve by boycotting.
There has been a worrying spate of violence, including killings, in the run-up to the polls.
Many Nigerians fear further violence on Saturday, which should lead to the first handover of power in Africa's most populous nation from one civilian to another.
President Obasanjo is standing down after two terms in office.