Most of the dozens of troops and oil workers taken hostage in a raid on a navy base and neighboring oil facility in southern Nigeria have been released, police said Wednesday.

The eight remaining hostages — employees of a subsidiary for Royal Dutch Shell PLC — should be freed within hours, said Hafiz Ringim, the police commissioner for Bayelsa state.

FOX News CountryWatch: Nigeria

Assailants wielding automatic rifles overran the navy base and occupied the nearby oil facility Tuesday. About 60 oil workers were held captive at the oil installation and an unknown number of navy personnel were held at the base. Most of the hostages were released late Tuesday.

"Last night there was a discussion between the government and militant leaders and we think we have reached an agreement," Ringim said. "We will see if the conditions have been fulfilled by noon."

He did not elaborate on the deal, but said the attackers had initially demanded that the oil company supply light and water to the local community and tackle erosion problems, he said. They also demanded money, although he declined to say how much.

Armed fighters frequently attack oil installations in Nigeria's poverty-stricken southern Delta. Although Nigeria is Africa's largest exporter of crude, government corruption means there is little infrastructure like clean water, regular electricity or roads. Many communities turn to the oil companies to provide services, provoking clashes when demands are not met.