Omar Bongo heads on of the world's richest first families. Photograph: Charles Platiau/Reuters

There are many ways of measuring Omar Bongo's rule. You could count the monuments: the Omar Bongo Triumphal Boulevard, the Senate Palace Omar Bongo, and the university, football stadium, gymnasium and military hospital that all bear his name. You could look at a map of Gabon, and find the name of his hometown, Bongoville, or work out how many French presidents he has befriended and outlasted: five, from Charles de Gaulle to Jacques Chirac.

Or you could gaze at any of the dozens of giant billboards dotted around the capital, Libreville, congratulating "Papa Bongo", who is pictured with his trademark moustache and his hands clasped together, for completing 40 years as president in December. Had it been known that Fidel Castro would step down as Cuba's leader just two months later, the signwriters would surely have stencilled on the title that Castro passed on to Bongo: the world's longest-serving leader that isn't a monarch.

That is no mean achievement, considering Gabon's neighbourhood. Since gaining independence, most countries in west Africa have experienced lengthy civil wars or successive military coups. Yet Bongo, who came to power in 1967 aged 31, has ruled largely unchallenged, and mostly without force, despite squandering much of the country's natural wealth and leaving it facing a deeply uncertain economic future.

"The man is a political genius," said Guy Rossatanga-Rignault, a political science professor at Omar Bongo University. "You think he's coming near to the end, but it's never the end with Bongo."

Bongo's rule has been a masterclass in the use of patronage. His ascent to the presidency coincided with Gabon's rise to being Africa's third-biggest oil producer, and he quickly realised that money could be more effective than bullets in keeping power.

He built some basic infrastructure in Libreville and, ignoring advice to establish a road network instead, constructed the $4bn (£2.02bn) Transgabonais railway line deep into the forested interior.

Petrodollars funded the salaries of a bloated civil service, spreading enough of the state's wealth among the population to keep most of them fed and dressed. France, whose companies were happily extracting Gabon's oil, guaranteed security by maintaining a military base in Libreville that still exists today.

When multipartyism was ushered in during the early 1990s following months of unrest, Bongo again found that money could solve any problem. Opposition politicians who criticised him in public, or showed any signs of popularity, were brought into the government, and soon compromised.

"This is Bongo's main secret to remaining in power for 40 years: corruption," said Mark Ona, the head of Brainforest, a leading NGO that was recently suspended by the government for speaking out about the misuse of state funds. "Nobody ever leaves the president's cabinet empty-handed."

The best cabinet positions, however, have always been reserved for Bongo's family. His son, Ali-Ben Bongo, is the minister of defence, and, it is whispered on the streets, the heir apparent. Bongo's daughter, Pascaline, is the head of the cabinet. Her husband, Paul Toungui, is minister of finance.

The scale of the high-level cronyism and corruption astonishes diplomats from other African countries. "In Gabon, government and business are one and the same," said one. "If you want to do business here, you must know a minister, or at least somebody with the surname Bongo."

Indeed, they may be one of the richest first families in the world. Bongo has a vast hilltop mansion, where passing motorists can view ostriches roaming the gardens and a couple of Rolls-Royces.

Most of his wealth is hidden overseas. In the 90s, US investigators found that more than $100m had passed through US bank accounts linked to Bongo, while in France it was alleged he had received tens of millions of dollars in kickbacks from the oil company Elf.

Last year, French prosecutors found the Bongo family owned 33 properties in France alone, including a $27m villa. At the same time, Ali-Ben Bongo's wife, Inge, appeared on a US reality television show, Really Rich Real Estate, shopping for a $25m mansion in California.

The theft of billions of dollars of oil money has stalled the country's development. Nearly 50 years after independence, Gabon has fewer miles of paved road than it has of oil pipelines.

Even within Libreville - which can seem deceptively well-off if you keep to the seaboard, with its hotels, casinos and patisseries - the lack of infrastructure is glaringly obvious. Many houses are connected by tiny footpaths filled with rubbish and tangles of hosepipes that serve as the mains water supply.

There is a serious shortage of schools and clinics. On paper, Gabon has one of the highest per-capita incomes in Africa, yet half of the population remains poor.

Paskhal Nkoulou Nguema of the Bongo Must Go political party, said that Gabon, with its small population of 1.3 million and its vast natural riches, should be like Dubai. "Bongo has somehow put in the mind of all Gabonese that this is the best place in Africa, the richest country that everybody wants to visit. He is like Machiavelli."

It is true that many Gabonese are proud of their country, and of Bongo. His success in keeping peace in a country with 40 different ethnic groups, while neighbouring countries have all experienced serious strife, is regarded as a significant accomplishment. But there is growing worry about what sort of legacy he will leave. Gabon's oil, which still provides the vast bulk of government revenue, is fast running out.

Gabon produces some sugar, beer and bottled water. Despite the rich soil and tropical climate, there is only a tiny amount of agricultural production. Fruit and vegetables arrive on trucks from Cameroon. Milk is flown in from France.

And years of dependence on relatives with civil service jobs means that many Gabonese have no interest in seeking work outside the state sector - most manual jobs are taken by immigrants.

"I love the president; he is our father, our chief," said Louis Gaston Mayila, a wealthy lawyer, and a former top government minister. "But stability is not enough. Our world is changing, and we need to look to the future."

A future without Bongo? Shortly after winning the 2005 election, Bongo quashed any public talk of succession by saying that he would run again in 2012. "The best is yet to come," he likes to say.

Profile

Albert-Bernard Bongo was born in Lewai (now Bongoville), in south-eastern Gabon in 1935.

A former lieutenant in the French air force, he became Gabon's leader in 1967 following the death of President Leon M'ba.

Six years later he converted to Islam, taking the name Omar.

He held Gabon's first multiparty elections in 1993, winning 51% of the vote. After term limits were removed from the constitution, he increased his share of the vote to 79% in 2005.

He is married to Edith Lucie Sassou-Nguesso, the daughter of Denis Sassou-Nguesso, president of the Republic of the Congo.