"Troops of Operation Base 2 repelled a hijack of a vessel (MT VAJARA) by heavily armed bandits in Ramos River, around Agge area of Delta state," Lieutenant Commander Thomas Otuji said in a statement.
He said the pirates were repelled last week after a fierce exchange of fire with government troops.
Ship hijackings have become more frequent since President Muhammadu Buhari last year announced he was winding down an amnesty to former militants in the oil-rich Niger delta region.
"Five suspected vandals were arrested and they confessed to their plan to vandalise the wellheads," he said, adding that two boats were recovered during the operation.
More From This Section
He said the military was committed to making the entire Niger Delta and the waterways safe for oil firms, vessels and their crew.
He said the military also recently responded to distress calls by travellers who were attacked by pirates in the southern states of Cross River and Rivers, adding that the troops had killed the criminals and rescued the travellers.
Nigeria has deployed troops to end renewed insurgency in the region.
Since the start of the year, several militant groups have attacked oil facilities, slashing Nigeria's output and hammering revenue.
The militant groups claim to be seeking a fairer share of Nigeria's multi-billion-dollar oil wealth for residents of the oil region as well as political autonomy
The Nigerian government has urged the oil rebels to embrace peace talks to end the unrest.
MEND, the most high-profile group blamed for devastating oil attacks in the region before it accepted a government amnesty in 2000s, said in a statement today it had always been ready for talks.
It said the talks would be held on October 31 between government representatives and the region's prominent leaders.
Oil-dependent Nigeria is struggling to emerge from a recession following falling oil prices and foreign exchange shortages that have led to a massive devaluation of the naira.