Gunmen killed two policemen in Nigeria's oil-producing Niger Delta as they slept in a security post on Monday evening and three soldiers were killed in a second attack, police and the army said.
The raids took place a day after five police officers were shot dead in the same region.
Recent violence has raised concern that militants might resume an insurgency that has been quiet for the past several years. A labour union on Tuesday called for the evacuation of oil workers from the region.
The army said it would use "all available means and measures" to crush militants attacking oil facilities, saying: "They will stand to regret the consequences of their actions."
The two policemen, who were asleep on guard duty, were killed in Delta's Rivers state, a police spokesman. The soldiers died in an attack in Bayelsa state, the army said.
Last week, a group known as Niger Delta Avengers attacked a Chevron facility in the Delta after claiming a strike in February against a Shell pipeline, which shut down the 250,000 barrel-a-day Forcados export terminal. The violence has pushed Nigeria's crude output near to a 22-year low.
"Best thing for any reasonable company to do is evacuate its workforce," said Cogent Ojobor, chairman of the Warri branch of the Nupeng oil labour union.
Chika Onuegbu, chairman of the trade union in Rivers state, said Chevron had evacuated some staff from the Delta following a similar move by Shell.
"There is high alert around various installation around the Niger Delta due to recent attacks," Onuegbu said. "Those evacuated are where their platforms have been attacked but others are working."
Ikeja Electricity, Nigeria's biggest power firm, said it expected extended outages after the attack on Chevron hit gas supplies needed to generate electricity.
Delta residents have long demanded a greater share of oil revenues. Crude oil sales account for about 70 percent of national income in Nigeria but there has been little development in the region.
President Muhammadu Buhari has extended an amnesty agreement signed with militants in 2009 to end their campaign to blow up pipelines, but has upset them by ending generous pipeline protection contracts.
The incidents are a further challenge for a government faced with an insurgency by the Islamist militant Boko Haram group in the northeast, and clashes between armed nomadic herdsmen and local people over land use in various parts of Nigeria.