Islamic State claimed responsibility on Wednesday for an attack on the convoy of a state governor who was headed to a rally in northeastern Nigeria ahead of Saturday's presidential election.
The group said in a statement on its Amaq news agency that 42 people were killed in Tuesday's attack on Borno state's governor. Official sources told Reuters earlier on Wednesday between three and 10 people were killed, and that some of them may have been beheaded.
Boko Haram has waged a decade-long insurgency in Nigeria's northeast which has killed around 30,000 people and forced about 2 million to leave their homes. Islamic State West Africa Province, which split from Boko Haram in 2016, has carried out a series of attack on military targets in the last few months.
Security sources said earlier on Wednesday the gunmen opened fire at the motorcade transporting Borno's state governor Kashim Shettima on his way from state capital Maiduguri to the market town of Gamboru for a rally.
Two security sources said three people died. A government and a separate security source said as many as 10 people were killed. Some of those killed may have been beheaded, they said.
There was no indication of how Shettima, a government politician, was affected by the attack. His spokesman could not be reached for comment. A security source said the convoy had returned to Maiduguri.
Borno, the birthplace of Boko Haram, has been the state worst hit by Islamist insurgents.
Incumbent Muhammadu Buhari is seeking a second term in office in Saturday's elections in Nigeria, Africa's biggest democracy. He faces a tight contest against his main challenger, Atiku Abubakar, a businessman and former vice president.