– The proliferation of billboards and glossy campaign fliers, plastered across windshields and storefronts here, gives the impression of a hard-fought battle for Somali votes. But the coming parliamentary and presidential elections, scheduled to take place over the next six weeks, won’t be decided by a democratic ballot.

They’ll be decided behind closed doors, by coalitions of powerful clan and militia leaders, often greased with illicit funds from abroad.

This year’s election was supposed to mark the culmination of Somalia’s democratic transition after more than a quarter-century of civil war. Instead it will be only slightly more inclusive than the last one, in 2012, when just 135 clan elders selected the Parliament that in turn voted on a president. It also may be tarnished, U.N. officials and opposition candidates say, by a surge in harassment of political activists and journalists by Somali security services.

“I think there are a lot of people who think they are deeply disadvantaged by this election — and they would be right,” said Michael Keating, the special representative of the U.N. secretary-general in Somalia, who maintains that the vote still represents a step forward for the country.

Some improvement

Security has improved in parts of Somalia since the last election, thanks mainly to a 22,000-strong African Union force that has dislodged Al-Shabab from most urban areas. But the Al-Qaida-linked group continues to carry out regular bombings and assassinations, killing a top Somali general and six of his bodyguards in Mogadishu as recently as Sept. 18.

But it’s not just Al-Shabab that stands between Somalia and a return to political normalcy. The clan violence that fueled the civil war throughout the 1990s and early 2000s has mostly subsided. The underlying clan rivalries, however, are still very much intact. And they have made everything from drafting a new constitution to federating the country to drawing up a plan for the current election — all things the government was supposed to have done by now — ­excruciatingly difficult.

After months of tortured negotiations, officials finally agreed that 14,025 “electors” representing the clans will select the members of the lower house of Parliament while the country’s recently formed state governments will nominate members of the upper house. Together, the two houses will elect a new ­president.

More than a dozen candidates have thrown their hats into the ring, but only a handful, including President Hassan Sheikh Mohamud, Prime Minister Omar Abdirashid Ali Sharmarke and former President Sharif Sheikh Ahmed, have the clan backing and financial support to be ­considered real contenders.

Like the Iowa caucuses

In an interview at his private residence in Mogadishu, Sharmarke likened the process to the Iowa caucuses in the United States. “We don’t have the primaries; everybody doesn’t vote. It’s just a caucus reflecting the larger society that is voting,” he said.

Sharmarke is arguably the front-runner to replace Mohamud, whose popularity has faltered amid persistent allegations of corruption. Sharmarke is the son of Somalia’s second president, Abdirashid Ali Sharmarke, who was assassinated in 1969.

A year and a half into his second term as prime minister, he acknowledges that progress on many of the government’s top priorities, including the constitution and the federalization process, has been slow. But he says the election is proof that things are headed in the right direction.

“Last time any election like this happened was 1969. Forty-seven years later, I think this is going to be a test of whether the country is ready for one-person, one-vote,” he said.

International donors have reluctantly come around to this view, having long ago dropped their insistence on a plebiscite open to all citizens. Already, however, there are worrying signs that the carefully designed electoral exercise may be marred by abuses. In July, the president told local media outlets that anyone who opposed his re-election bid was Somalia’s second-biggest enemy, after Al-Shabab. Since then, there have been numerous reports of harassment and intimidation of candidates who are challenging the president, especially those without the backing of powerful clans.

“I am subject to all-day harassment from him, from security,” Abdirahman Abdishakur Warsame, a former planning minister who is also running for president, said of Mohamud and his allies.

“I don’t believe it will be a fair and free election,” Warsame said. “The president will try to use the government machine and money against us.”