Ndinge Mouetse, an official at the attorney general's office, said that they had called on the embassies of West African states in Gabon to help identify and repatriate the bodies.
A police officer told the agency that there may be survivors.
He said that people had been seen landing on the beach between 3am and 4am (02:00 to 03:00 GMT).
Andre Mba Obame, interior minister, said the loss of boatloads of migrants was "frequent" off Gabon, adding that "tens of thousands" seek to enter the oil-producing country each year.
Human rights groups say that hundreds of people drown off Africa's west coast every year as they try to reach Spain's Canary Islands in a search of a better life in Europe.
Traffickers regularly cram 200 or 300 people into pirogues often powered by ancient outboard motors and poor quality fuel.
Gabon's own relative prosperity, funded by oil, has also made it a favourite destination for illegal migrants from nearby countries.
At least 400,000 people - or almost a third of Gabon's population - are illegal immigrants, he said.