JUBA, Sudan — After five decades of guerrilla struggle and two million lives lost, the flags are flapping proudly here in this capital. The new national anthem is blasting all over town. People are toasting oversize bottles of White Bull beer (the local brew), and children are boogieing in the streets.

“Free at Last,” reads a countdown clock.

But from the moment it declares independence on Saturday, the Republic of South Sudan, the world’s newest country and Africa’s 54th state, will take its place at the bottom of the developing world. A majority of its people live on less than a dollar a day. A 15-year-old girl has a higher chance of dying in childbirth than she does of finishing primary school. More than 10 percent of children do not make it to their fifth birthday. About three-quarters of adults cannot read. Only 1 percent of households have a bank account.

Beyond that, the nation faces several serious insurrections within its own sprawling territory and hostilities with northern Sudan, its former nemesis.

It is clearly an underdog story.

So many people here embody the distance traveled and the hopes to come. James Aguto, a former child soldier and longtime guerrilla fighter, now delivers babies. Mr. Aguto is a newly minted clinical officer, working in a government hospital, and his journey from taking life to sustaining it makes him an apt symbol for the transition this country is trying to make.