Pirate attacks have been on the rise in West Africa. The International Maritime Bureau (IMB) says there were some 100 pirate attacks in West Africa last year.
The tanker, the African Prince, belongs to the Nigerian National Petroleum Company and was thought to be carrying more than 5,000 tonnes of refined oil, according to the BBC.
Nigeria is one of the world's biggest oil producers but has a major problem with oil theft by crime syndicates in the oil-producing Niger Delta region.
Ghana's defence ministry says the ship is being escorted back home by the Nigerian navy.
The rest of the crew - 22 Nigerians and six Pakistanis - have been helping the Ghanaian authorities with their investigations.
Following the recent pirate attacks in the region, Ghana says it is strengthening its maritime security.
The IMB says attacks in West Africa usually take place while ships are at anchor or close to coastal areas, unlike in eastern Africa, where Somali pirates strike ships hundreds of miles out to sea.