Omar Bongo died of a heart attack at a clinic in Spain
Africa's longest serving leader -Gabonese President Omar Bongo - has died aged 73.
His death was confirmed by Prime Minister Jean Eyeghe Ndong in a written statement.
There had been conflicting reports earlier on Monday about whether Mr Bongo, who had led Gabon since 1967, had died in a Spanish clinic.
In his statement, Mr Ndong said Mr Bongo had died of a heart attack shortly before 1230 GMT.
He said Gabon would observe 30 days of mourning, and called on the Gabonese people to "stand together in contemplation and dignity".
The defence ministry said it was closing Gabon's air, land and sea borders.
The ministry, which is headed by Mr Bongo's son, Ali-Ben Bongo, also said in a statement on national television that "all components of the defence forces were put in place across the territory", and that sensitive buildings were being secured.
Under the constitution, the leader of the Senate, Rose Francine Rogombe, an ally of Mr Bongo, should take over as interim leader and organise elections within 45 days.
The BBC's Linel Kwatsi
Reporting from Libreville
The officials here are not used to organising a handover of power - this is the first since Omar Bongo came to power 42 years ago.
For most Gabonese people, he is the only leader they have ever known.
One person told me that he had always wanted Bongo to leave power but now that he is no longer there, he feels sad and afraid of what may happen next.
Another man said that the authorities should have been more honest.
Few people here believed the official denial of Bongo's death on Monday morning.
Many think the news was delayed to allow senior officials to buy time and try to organise the succession - possibly to enable his son to take over.
But opposition leaders have claimed that Ali-Ben Bongo has been lined up to take over, and question whether any election would be free and fair.
In the capital, Libreville, the BBC's Linel Kwatsi said people had reacted to the earlier rumours of Mr Bongo's death by stockpiling food. They feared shops would shut if it was confirmed.
The internet has been cut off since Sunday, while state television is playing religious music.
French President Nicolas Sarkozy expressed his sadness over the death of Mr Bongo. He said France was "standing by the people of Gabon and its institutions, at this difficult time".
Gabon under Mr Bongo has maintained close economic and political ties to France, the former colonial power.
Mr Bongo became vice-president, and then president, of Gabon in 1967.
He stopped work in May, and entered a clinic in Barcelona. Government officials insisted it was for a check-up, but other reports said he had cancer.
Mr Bongo faced a French inquiry into corruption allegations.
Oil earnings mean that Gabon is officially one of Africa's richest states but analysts say that the political elite have kept most of the money for themselves. Most of the country's 1.4 million people live in poverty.
Mr Bongo was one of three African leaders being investigated for alleged embezzlement by a French judge. The others are Denis Sassou-Nguesso of the Republic of Congo and Teodoro Obiang Nguema of Equatorial Guinea.
It is alleged that the properties owned by Mr Bongo's family in France could not have been purchased with official salaries alone.
Mr Bongo denied any wrongdoing.