KIRKUK, Iraq - When I traveled to Kirkuk in years past, this northern city was a byword for ethnic violence and the deep-seated animosities that were in the process of unraveling Iraq. Under Saddam Hussein, the city and surrounding rural areas were brutalized in a massive social engineering program termed "Arabization," which resulted in the ethnic cleansing of Kurds and Turkmen to make way for Arab settlers. Since Saddam's fall, the Kurds have gained the upper hand -- but continue to face relentless resistance from Arab diehards. In the last six months, for instance, al Qaeda operatives have hit Kirkuk with an astounding 22 car bombs and four attacks by terrorists wearing suicide vests. That's a remarkably high figure for a city of less than half a million souls, putting it in the same league as insurgent hotbeds like Fallujah and Mosul. But I had heard something was changing in Kirkuk, and wanted to see for myself. On Oct. 27, I traveled to the city and got an inside look at the government's operations under its dynamic governor, Najmaldin Karim, a neurosurgeon who lived for over three decades in Silver Spring, Maryland. Upon my departure from the city, I experienced a most unusual sensation -- optimism for Iraq. The progress I could see was subtle but unmistakable: Car bombings have begun to decline, and projects to construct new roads, bridges, and sewage networks are gathering pace. New parks, a key sign of communal pride and public life, are beginning to grow green. The average citizen in Kirkuk lives life on two levels. On one level, he or she is just trying to get along, make a living, and keep their families safe. But at another level, each major ethnic group can point to communal trauma inflicted by the region's violent past. For example, Turkmen and Kurds dominated Kirkuk in the decades before the oil industry rose in the 1920s -- but were later oppressed by successive Arab-led governments in Baghdad, who evicted them from their properties to make way for Shiite and Sunni Arab settlers. Following Saddam's fall and a mass return of displaced persons, the Kurds now make up the majority of the provincial council, dominate the security forces in Kirkuk, and set the political agenda for the province. The effects of settlement and resettlement have now created an ethnic knot that is almost impossible to unravel. Kirkuk is essentially the site of the world's most exquisitely intractable land dispute: Kurdish refugees, for instance, squat in government buildings that were built on demolished houses taken by Saddam from Turkmen town-dwellers. Meanwhile, young Arabs who were born and grew up in Kirkuk -- and who knows nothing but life as residents of the city -- fear the loss of their residency because their parents came as settlers under Saddam Hussein. The struggle for power between the central government in Baghdad and the semi-autonomous Kurdistan Regional Government (KRG) also reverberates across Kirkuk. Both Baghdad and the KRG, which controls the areas right up to the northern suburbs of Kirkuk city, lay claim to the Kurdish-controlled areas. The conflict has prompted tense military stand-offs and frozen in limbo the question of whether the city falls under the control of the KRG or the central government. For a long time, these challenges seemed insurmountable. Slowly but surely, however, Kirkuk's administrators have reestablished a degree of normalcy -- even prosperity -- to their corner of Iraq. Much of the credit should go to Karim, who was sworn in as Kirkuk's governor in April 2011. The governor, a native of Kirkuk and a Kurd, has a long history of political involvement in the region: After completing his medical studies in Mosul, he joined the peshmerga, the Kurdish paramilitary fighters, and participated in the anti-Saddam insurgency throughout the early 1970s. When that struggle collapsed, he traveled to the United States in 1975 as the personal physician for the Kurdish leader Mustafa Barzani, the father of current KRG President Massoud Barzani. While in the United States, Karim served the Kurdish exile community as the head of the Washington Kurdish Institute, and also ran a successful medical practice as a neurosurgeon in Maryland for over 30 years. In 2010, Karim returned to Iraq and won a seat in parliament, but soon grew frustrated by the deadlock at the national legislature. He refocused on local politics in his native Kirkuk, where the Kurdish-majority provincial council appointed him to fill a void in the province's leadership. Though a card-carrying member of one of the Kurdish parties, the Patriotic Union of Kurdistan (PUK), Karim stands in good stead with the Barzani's Kurdistan Democratic Party, due to his service to Barzani's father. Since returning to serve Kirkuk, Karim has shaken up the local government -- and ruffled more than a few feathers in the process. The governor is all business, and can seem gruff at first glance. After decades running a busy medical practice in the West, he is impatient with the red tape that strangles governance in today's Iraq. But in local government meetings and in visits around the city, the governor appeared to be winning the respect and affection of Kirkuk residents. As I shadowed Karim as he went about his daily routine, I could see why. While governors often act as a crippling bottleneck on local development in this country, Karim's office was efficient: Every morning, he turns to an enormous ledger of authorizations and letters to dispatch, then holds disciplined roundtables with key municipal leaders. The afternoons and evenings, meanwhile, are reserved for a more traditional ad hoc agenda of personal meetings. One of Karim's key challenges is that Kirkuk's disputed status makes it something of a political orphan. Neither Baghdad nor the KRG want to invest heavily in the province, in case it reverts to the other in the future. As one frustrated provincial council member put it: "To them both, we are another country." Though a Kurdish politician through and through, Karim has tried to remove Kirkuk from these ethnic battles -- sometimes clashing with the KRG in the process. Though some of Kirkuk's electricity and security assistance are provided by the KRG, the provincial government gets 95 percent of its budget from Baghdad. This affects Kirkuk's attitude to the federal government: For instance, Karim showed all due deference to Prime Minister Nouri al-Maliki when he made a surprise visit to Kirkuk in May 2012. On Nov. 6, the governor welcomed to Kirkuk the BP CEO Bob Dudley and the federal minister of oil -- a move that the KRG criticized on the grounds that Kirkuk is a disputed area, and that the KRG should be consulted on any oil deals. At other times, the governor has pushed back against Baghdad. He strongly resisted Baghdad's attempt to take over security in Kirkuk by establishing the controversial Tigris Operations Center, a new headquarters led by an unapologetic Saddam-era general with a history of needling the Kurds in Kirkuk. Karim also requested that the KRG place Kurdish peshmerga forces under the provincial council's command to secure the city's southern flank and commissioned an anti-car bomb trench to funnel vehicle traffic to new checkpoints. Car bombings launched from the Arab farm belt are now reducing from weekly to monthly occurrences. Roadside bombs have declined in frequency and lethality, while rocket attacks have gone from a regular event to a rare nuisance. Second only to security improvements, the governor's focus is winning the uphill battle to spend Kirkuk's investment budget. The federal treasury in Baghdad provided Kirkuk with around $763 million in 2013 -- buoyed by a "petrodollar" scheme that provides the province with $1 per barrel of oil produced or refined, and $1 per 150 cubic meters of gas processed. This figure is likely to increase fivefold next year under new provincial powers legislation. Though the petrodollars only arrived from Baghdad in June, Kirkuk had already spent $430 million by late October or 54 percent of its total budget in just five months. Further spending is also in the works before the end of 2013. By Iraqi standards, just managing to execute the budget is a remarkable achievement: In 2012, Kirkuk spent 88 percent of its budget, while the governor's office in the southern province of Basra spent 35 percent -- and had to send the unspent funds back to Baghdad. The trick, local officials related, is preparation of procurement plans before time and streamlined tendering -- vital factors that are lacking in much of Iraq. To ensure the money is well spent, the governor's office performs basic due diligence on contractors, and gives them trial runs to assess whether they can deliver. If they succeed, they get used again; if they underperform or inflate the price of their work, they get blacklisted. Corruption and misuse of public funds also appear to have been kept at a minimum. A Facebook site has been set up by the governor's staff to receive feedback on projects from the general public. Through the site, citizens have alerted the governor's office to shoddy workmanship in some local projects and explained the needs of their individual neighborhoods. It's an example of how new media has helped close the gap between provincial leadership and their constituents. In the near future, as Kirkuk's petrodollars rise from hundreds of millions to billions, these basic measures must give way to true institutional capacity-building. The governor's office will need to be able to tender and award mega-projects and ensure that oil money doesn't encourage large-scale corruption. But for now, Kirkuk's budget management is far ahead of most other Iraqi provinces. There's no denying Kirkuk still has a long way to go to achieve basic security and prosperity. But for the first time in a long time, there may just be a light at the end of the tunnel. Terrorist attacks are becoming less destructive, though the raw numbers of attacks in Kirkuk city remains largely unchanged at roughly 24 per month. Economic reconstruction also has a long road ahead: The bones of the city -- water, sewage system, electrical supply, and roads -- need to be painstakingly rebuilt after a half-century of neglect. Booming oil revenues, however, could give Karim a chance to do just that. In late October, I left Kirkuk in the pre-dawn dimness and found myself in Dubai by the afternoon. The contrast between Kirkuk's downtrodden shabbiness and the bustling Gulf emirate was stark -- though less extreme than it would have been just a few years ago. Some of Kirkuk's brand-new thoroughfares and spaghetti junctions recall the early threadbare days of Dubai's rise as a metropolis. Billions of dollars are coming in to Kirkuk in the near future, and there is growing hope that the provincial leadership can spend them wisely. In Iraq, hope is arguably at least as valuable a commodity as oil -- and much rarer. In this visit, I saw a glimpse of the potential inherent in Kirkuk and perhaps in the whole of Iraq. An idea -- loyalty to Kirkuk and all her people -- is resulting in progress, thanks to the combination of effective leadership and oil wealth. If this can continue in fractured Kirkuk, might not the same formula work one day in Iraq writ-large? That may be optimistic, but it's certainly not impossible.