Government sites including the ministries of communications and the civil service were inaccessible on Sunday, as were the websites of at least 30 other institutions.
The presidency website continued to function as normal.
“Huge surprise attack against the government of Gabon today,” read a message on a Twitter account close to the Anonymous group.
“More than 70 government sites (attacked). All their servers and mail systems are offline. The dictators should have been expecting us,” the tweet continued.
Gabon’s agency for digital infrastructure, ANINF, said the administration had been hit by a denial of service (DOS) attack.
The agency said 60 of 102 websites “were taken offline for a few hours”, though AFP was still unable to connect to them at 18:00 local time.
ANINF added that it might take judicial action against anyone found to be involved in the attack.
Hackers from the loose-knit Anonymous collective have taken aim at a string of high-profile targets around the world in recent years.
The group originated in 2003, adopting the Guy Fawkes mask as its symbol. The mask is a stylised portrayal of an oversized smile, rosy cheeks and a wide moustache upturned at both ends.
This was the first time the Anonymous group has claimed responsibility for action in a central African nation.
In August Anonymous hackers claimed responsibility for bringing down government websites in Spain, in protest at Madrid’s efforts to block Catalonia’s separatist drive.