Three people were killed and 21 injured by an explosive device thrown from a car at an election rally near Nigeria's capital Abuja on Thursday, the latest act of political violence ahead of nationwide polls next month.

The device missed the centre of the ruling People's Democratic Party (PDP) rally in the town of Suleja, on the northwestern edge of Abuja, but landed close to where street traders were working, police said.

Some people in a moving vehicle threw an explosive at a rally organised by the PDP in Suleja, national police spokesman Olusola Amore told Reuters.

Unfortunately for them, the explosive missed the (centre) of the rally and exploded where women and other hawkers were selling things. Three people were killed on the spot and 21 wounded, he said.

The attack happened after the main programme at the rally had come to an end, said Yushua Shuaib, spokesman for the National Emergency Management Agency (NEMA). He said the injured had been rushed to hospital.

Africa's most populous nation holds presidential, parliamentary and state governorship polls in April and the main candidates in all three sets of elections have been holding campaign rallies around the country.

President Goodluck Jonathan, who was campaigning far away in the southwest when the attack happened, is seen as the frontrunner in the presidential race. But local elections are expected to be more fiercely contested and there have already been localised acts of violence.

No one immediately claimed responsibility for the Suleja attack and no arrests have yet been made, Amore said.

The perpetrators of a car bomb in Abuja on New Year's Eve have still not been identified and there have been several attacks on opposition party offices and campaign rallies in Bayelsa state in the southern oil-producing Niger Delta.

Radical Islamist sect Boko Haram has been blamed for a spate of attacks on local government officials in Borno state in the remote northeast, while sectarian clashes around the central city of Jos have killed more than 200 people since December.