For months, powerful factions in Nigeria's ruling party have been campaigning relentlessly against the chairman of the national election commission. In garish full-page advertisements, they attacked his credibility and competence, accusing him of plotting against them and even using cartoon caricatures to mock him.
Yet as millions of Nigerians head to the polls for a historic election on Saturday, electoral chief Attahiru Jega appears to have survived the onslaught – and so has Nigeria's young democracy, so far at least. The election could be the fairest in Nigerian history, thanks largely to Mr. Jega's courage and independence.
The election is seen as the most closely contested in Nigeria's modern era, and the first with a legitimate chance of an opposition victory. If the voting is free and fair, and if the results are accepted, it will be a major victory for African democracy as the continent enters a crucial 18-month testing ground.
Across the continent, autocrats are seeking to extend their power, using a range of dubious tactics to entrench their dominance. But in a growing number of countries, Africans are resisting their rulers, using street protests and the power of the ballot box to defend and revive democratic ideals.
It began in Senegal in 2012, after then-president Abdoulaye Wade used a controversial court ruling to seek a third term in power. People took to the street in protest, and defeated him at the polls. He was obliged to step down.
In October, the rebellious mood spread to Burkina Faso where former military-coup leader Blaise Compaoré had held power for 27 years. When he sought to amend the constitution to extend his rule, thousands of angry citizens took to the streets , finally forcing him to resign. The uprising sent shock waves across Africa.
From now until 2017, democracy will be tested further. The election in Nigeria is the first challenge, but equally difficult tests are expected in Burundi, Rwanda, Benin and the Democratic Republic of the Congo and its neighbour, the Republic of the Congo. In each country, presidents are positioning themselves to seek a third term in power, often in defiance of constitutions or other agreements.
Yet there is resistance to these schemes – an often surprisingly strong resistance – partly as a ripple effect from the Burkina Faso uprising. It's too early to call it an "African spring." But democracy seems to be spreading.
Two of the biggest battles are now under way in Burundi and the Democratic Republic of the Congo, countries that have emerged only recently from years of civil war.
Both countries have a history of political violence and repression, yet protesters have braved the dangers in unprecedented street rallies. The protests in the DRC capital of Kinshasa, which led to dozens of deaths in clashes with police, were so strong that the government shut down the nation's entire Internet and cellphone text messaging services for three weeks in an effort to crush the unrest.
"These are massive, landmark events," said Stephanie Wolters, a Central Africa expert at the Pretoria office of the Institute for Security Studies, an Africa-based think-tank. "It's no longer business as usual. There's a revitalization of the importance of elections. There's a reconnection between people and politics, and people believe they have a voice. And that's new."
Even in the Republic of the Congo, where the authoritarian regime rarely permits protests , the government was so worried about protests that it imposed a curfew in the capital, Brazzaville, during a key African soccer tournament match. It was afraid that any soccer gatherings would turn political.
"Burkina Faso is on everyone's mind," Ms. Wolters said. "It has changed the game in many ways. Presidents have to keep it in mind now."
Indeed, a visit this month by pro-democracy activists from Burkina Faso and Senegal seemed to enrage DRC President Joseph Kabila who has been quietly manoeuvring for a third term. When the activists held a press conference in Kinshasa, his police raided the event and arrested 30 people including activists, journalists and a U.S. diplomat.
In Nigeria, democracy has been slowly building momentum. For most of their modern history, Nigerians were ruled by colonial masters or military commanders. Democracy was not restored until 1999, and since then it has been tainted by widespread corruption, vote-buying, ballot-box-stuffing, election violence and intimidation.
But polls show that Nigerians still strongly support democracy. A survey released this month by the Afrobarometer research project, based on face-to-face interviews with 2,400 Nigerians, found an overwhelming 65 per cent support democracy while only 21 per cent say that non-democratic forms of government can sometimes be better.
The same poll found that most Nigerians interviewed are dissatisfied with their own democracy. Most don't trust their leaders and are convinced that their politicians are corrupt, and only 39 per cent approve of President Goodluck Jonathan's performance.
But this doesn't diminish their support for democratic ideals. For example, 75 per cent said the president should be limited to two terms in office, and 60 per cent said the president must always obey the laws and the courts.
Another poll this year, conducted for the Washington-based International Foundation for Electoral Systems, found that 79 per cent of Nigerians surveyed planned vote in the presidential election. It also found strong majorities in support of the electoral commission, headed by Mr. Jega.
So when the ruling party factions attacked Mr. Jega and sought to depose him, the tactic failed. Most Nigerians supported him.
Mr. Jega, a respected scholar and professor who opposed Nigeria's military regime in the 1990s, has led the electoral commission for the past five years. In one of his most crucial moves, he used fingerprinting technology to get rid of duplicate registrations by voters who had illegally registered multiple times in ballot-stuffing schemes. By the time he finished, the commission had eliminated a stunning total of nearly five million duplicate names from the voter rolls. He also helped introduce new voting cards and electronic card readers to further reduce the chances of electoral fraud.
The trends aren't so positive everywhere in Africa. Many authoritarian rulers have maintained their grip on power for decades, including those of Angola, Uganda, Zimbabwe, Cameroon, Chad, Eritrea and Equatorial Guinea. Elections in Sudan in April and in Ethiopia in May will be tightly controlled by the ruling party, with no real opposition permitted. Rwandan President Paul Kagame is believed to be preparing for constitutional changes to give himself a third term, and little resistance is expected there either.
But in the place where it all started, Senegal, there was another democratic breakthrough this month. Rather than extending his rule, President Macky Sall is actually reducing it. He announced a referendum that would authorize a shortening of his term in office, from seven years to five years.
"Have you ever seen presidents reduce their mandate?" Mr. Sall said at a news conference. "Well, I'm going to do it."