Gunmen have killed a soldier guarding a church in northeastern Nigeria, the army said on Monday, the latest in a string of attacks in a region with a history of religious violence.

The soldier was shot on Sunday in Maiduguri, a city in one of the poorest region's of Africa's most populous nation where suspected members of an Islamist sect have killed more than a dozen people in a series of attacks over the last month.

The army did not confirm who was behind Sunday's shooting.

The soldier was attacked at his duty post at the church in the early hours of Sunday when he was killed and his rifle stolen, army spokesman Abubakar Abdullahi said.

Nigeria's population of more than 140 million people is roughly equally divided between Christians and Muslims, who generally live peacefully side by side, but regional and ethnic rivalries bubble beneath the surface.