The two were shot late Thursday as the country was hit by violent demonstrations in poor neighbourhoods against a stepped-up curfew and a ban on leaving or entering the capital.
For three days, urban dwellers across the country have banged on pots and gas cans, and on Thursday, clashes broke out with police.
National police chief Serge Herve Ngoma said in a filmed statement that protesters had put up barricades and fought police with Molotov cocktails, rocks and iron bars.
“In circumstances that have not yet been established, two curfew violators in Libreville were hit by gunfire and died from their wounds,” he added.
The police chief said an investigation had been launched and if sanctions would follow if mistakes had been made.
Prosecutor Andre Patrick Roponat also said an investigation had begun, and added that “people wearing ski masks in a car had opened fire”.
Gabon has moved up a curfew to 6 pm and blocked movement in and out of Libreville to curb a surge in coronavirus cases.
Bars and dance clubs have been closed for the past year, and large parts of an informal economy that many depend on have suffered from anti-Covid measures.
Gabon, which has fewer than two million inhabitants, has reported around 12,500 cases of the virus, and 75 deaths.
One-third of the cases were reported in the past two months however, as a second wave hit the country, Health Minister Guy Patrick Obiang Ndong noted.