Pirates have killed the captain and chief engineer of a cargo ship they attacked off the coast of Nigeria.

The International Maritime Bureau said the attack happened about 120 miles south of Lagos.

The ship tried to escape but both the captain and chief engineer were shot dead during a firefight.

Piracy in the Gulf of Guinea has escalated from low-level armed robberies to hijackings and cargo thefts.

West African pirates also have been more willing to use violence - beating crew members, and shooting and stabbing those who get in the way.

The killings came after another ship nearby was attacked this weekend and pirates hijacked a tanker ship off the coast of neighbouring Benin on Thursday.

In the latest attack most of those onboard the unidentified cargo ship fled into a secured room as a gunfight raged, while those on the bridge remained at their posts, the piracy monitoring group said.

The captain and chief engineer died of their wounds as the pirates sprayed the ship with gunfire.

On Saturday, a cargo ship about 80 miles from Lagos came under attack from two boats, the International Maritime Bureau said. The crew hid inside a safe room as pirates shot at the ship, but left after about 25 minutes, the bureau said.

The attacks are just the latest to target West Africa's Gulf of Guinea, which follows the continent's southward curve from Liberia to Gabon. Over the last year, piracy there has escalated from low-level armed robberies to hijackings and cargo thefts.

In August, London-based Lloyd's Market Association - an umbrella group of insurers - listed Nigeria, neighbouring Benin and nearby waters in the same risk category as Somalia, where two decades of war and anarchy have allowed piracy to flourish.