The ship's owner, French company Sea Tankers, said the M/T Gascogne was freed after pirates stole part of its cargo.
It said all 17 crew members are reported safe, but two were injured during the incident and are being given medical treatment.
The International Maritime Bureau confirmed the release of the ship and crew and said the vessel is heading to a safe port.
Piracy has been on the rise in West Africa. In a separate incident Monday, gunmen fired on a chemical tanker in Lagos, Nigeria. The gunmen were driven away by security guards but one crew member was wounded in the fighting and later died.
Last month, pirates hijacked a ship carrying 5,000 tons of oil as it prepared to unload in the Ivorian port of Abidjan. The hijackers stole the entire cargo before releasing the tanker and its 16 crew members.
The International Maritime Bureau has current piracy warnings for ships traveling near ports in Nigeria, Ivory Coast, Togo and Benin.