In Lagos, Nigeria’s largest city, things are looking up. Since civilian rule returned to the country in 1999, the city’s government has improved basic services, updated its infrastructure, and increased public safety. And as investors flock to one of Africa’s biggest economies, business there is booming.

That’s quite an achievement in a country that earns over $50 billion in oil revenue each year but will soon have more people living below the poverty line than China. The average life expectancy for Nigeria’s 174 million people -- just 52 years -- is one of the world’s lowest. Pirates and armed militant groups are prevalent in the south, sectarian conflict troubles the country’s so-called middle belt, and a bloody Islamist insurgency has a foothold in the north. There are 12 confirmed cases of the Ebola virus. Next year’s presidential election will likely bring even more tumult, spurring new attacks by the terrorist group Boko Haram.

Yet life in Lagos is improving, and so the city offers a potential lesson for struggling states looking to stage a turnaround. Mayors and city councils are far more likely to embrace positive change than legislatures and presidents -- and more quickly. Local politicians face much greater pressure to serve their constituents and are less likely than politicians in the central governments, who have access to more wealth and more power, to give in to corruption and cronyism.

To be sure, a city-first strategy would not cure all of Nigeria’s woes. Only the central government can address such violent actors as Boko Haram, for example. But empowering and strengthening urban governments would create a host of opportunities for new political leaders to enter the fray. And if other cities can emulate Lagos, entire countries could be transformed.

WHEN POLITICS IS LOCAL

One key to Lagos' recent success has been regular local elections, which the city has been holding since 1999. In contrast with elections at the national level, which are primarily contests for control over oil wealth, local votes force politicians to demonstrate that they can competently solve problems.

Over a decade later, positive signs are everywhere. Although traffic jams -- known in Nigeria as “go slows” -- do still occur, they are not nearly as bad as before. The roads are smoother, traffic lights function properly, new expressways are under construction. Buses speed along in a dedicated lane, part of Africa’s first rapid-transport bus system. And the city is following through with plans for a light-rail system, which could eventually include seven lines and carry hundreds of thousands of passengers.

As the city’s population balloons, the local government has embraced cleanliness as a civic virtue. Governor Babatunde Fashola’s favorite slogan is “Eko o ni baje,” which in Yoruba means “Lagos will not be spoiled.” His administration has posted signs everywhere to promote the idea: “Embrace Cleanliness,” says one. “Don’t mess with Lagos,” reads another. “No loitering, no hawking, no waiting, keep moving, don’t urinate here.” And the city has employed local toughs as street sweepers.

Although Nigeria’s public doctors are on strike (leading the president to fire 16,000 of them), organization and hustle have thus far enabled Lagos to contain the Ebola virus within its borders. When a man infected with the virus arrived in the city in July, officials quickly trained a team on how to check for the virus, turned an abandoned building into an isolation unit, and managed to find scores of people who may have touched him.

The city is also benefiting from an investment boom. Whereas foreign companies once avoided the city because of its broken physical infrastructure, corruption, and lack of security, they now flock to what is both the commercial capital of Africa’s most populated country and one of the largest consumer markets on the continent. Multinational companies, such as Procter & Gamble, Nestlé, and Guinness, have established a presence in Lagos, and regional retailers such as ShopRite, SPAR, and Massmart have opened stores there, too.

Much of the economic upturn is the result of exceptionally good leadership. Both Bola Tinubu, who served as governor of Lagos State between 1999 and 2007, and his successor, Babatunde Fashola, a plain-speaking 50-year-old lawyer, have played pivotal roles. Fashola, one of the few popular politicians in a country where they are usually despised, won reelection in 2011 with 81 percent of the vote. Meanwhile, a growing number of Nigerians have returned home after living abroad to work in the increasingly professional city government. Returnees have run Lagos’ electricity board, worked on its nascent subway line, landscaped its city parks, and staffed the governor’s office.

With Nigeria’s devolution of power to local governments, a product of the country’s brutal civil war in the late 1960s, local leaders know that improved performance will lead to more government revenue. The better the city’s infrastructure, public services, and business environment, the larger its tax base will be. As a result of its innovative policies, Lagos has increased its annual revenue from $3.7 million in 1999 to $124 million in 2013, and it now earns three-quarters of its budget from local taxes. By contrast, Nigeria’s central government depends primarily on oil revenue, creating few incentives to invest in more sustainable growth. Abuja also has terrible spending habits: Lagos spends three-fifths of its budget on long-term capital projects, whereas the national government spends more than two-thirds of its revenue on salaries and other recurrent expenses.

CITIES FIRST

Lagos, of course, is by no means an urban paradise. The city still has more than two hundred slums, cars there belch fumes into the heavily polluted air, and the majority of the population live below the poverty line. But these persistent problems underline why Lagos is a realistic model for other cities in the developing world -- even such war-torn countries as Afghanistan and Libya.

As Lagos has shown, a system of governance centered on cities and dependent on local taxation offers the best chance of changing political incentives in developing and fragile states. Although the correct balance between central and local governments would vary by country, a substantial portion of a state’s resources would have to flow toward governors, mayors, and local councils. And, in turn, these leaders would have to take on much larger portfolios than they typically do today.

A city-first strategy would also take advantage of one of the biggest trends occurring across the developing world: urbanization. Villages are emptying as people flood into cities in search of opportunity. Whereas in 1950, about a sixth of the people living in the world’s less developed countries were urban dwellers, today, that fraction is about one-half and is expected to reach two-thirds.

Elsewhere in the developing world, other cities offer hopeful case studies. Urban-based governance is reducing fragility in some countries that have empowered urban or local governments to act on their own. In Bogotá, Colombia, for example, Mayor Antanas Mockus used new powers devolved by the central government to transform the city during two nonconsecutive terms in office in the mid-1990s and early 2000s. At relatively little cost, he reduced violence, improved public transport, and enhanced the city’s finances. He gained fame as mayor for launching a series of humorous and surprising campaigns, often involving local artists, that transformed public norms regarding corruption, women’s rights, water usage, taxpaying, and driving, among others. (He once hired more than 400 mimes to point out traffic violations on Bogotá’s dangerous intersections.)

Indian cities such as Chandigarh, Hyderabad, Pune, and Shimla have similarly outperformed their national government in New Delhi. Chennai, which the magazine India Today recently named the country’s best-governed city, has outperformed the country’s other major cities in a host of areas -- owing in large part to its strong social cohesion, technocratic administration, and large industrial base.

Central governments do have an important role to play, but they should focus on areas where they add the most value, such as planning large-scale infrastructure projects, managing the money supply, setting national standards, and maintaining foreign relations. They also need to provide basic security. All of these public services extend beyond the scope of any particular urban administration The key is to maintain a more balanced division of labor. That would allow cities to step up -- and carry their countries with them.