IT is a country that only came into being two years ago, where every national institution is being built from the ground up as its leaders cope with the legacy of 50 years of war, chronic poverty and warring factions within its borders.

Yet as South Sudan emerges from its dark past to take its place on the international stage, its police chief has turned to Scotland to help set up the infrastructure that will extend the rule of law to the sometimes lawless areas within its borders.

General Pieng Deng Kuol was a guest at last week's Scottish ­International Policing Conference in Edinburgh, where he was on a mission to study the lessons learned during the recent merger of ­Scotland's police forces and the ongoing work to create a truly national service.

The trip follows the establishing of a relationship with the ­Scottish Police College at Tulliallan, which has provided leadership and management training to the South Sudanese in the past.

A former freedom fighter who rose to prominence during the war against the Sudanese government in Khartoum, Kuol faces the task of creating his country's police force against a backdrop of tensions between tribes, with few resources beyond raw recruits in a land-locked country with only one paved highway.

With no police training, the ­dignified former engineering student turned soldier knows he faces a hard task, but has been inspired by his trip to Scotland.

He said: "I was fighting for the country and had never been a policeman, and many of my colleagues have the same background.

"There are some who were ­militia and who were fighting for the government.

"There are those who were in the police in Sudan who were governing us and have now become South Sudanese police.

"There are those who have just decided to join the police, but have no training or even army ­training. Then there are those who are in the army and who have just joined the police.

"And now it is me who has to make them into a police force."

South Sudan experienced two civil wars, the first starting in 1953, before a peace agreement with Khartoum was signed in 2005.

Between 1983 and 2005 about two million people died and several million more were displaced. The country finally gained its independence in July 2011.

Now the task is to build a modern state in a nation where most people's affiliation lies with their family and their tribe, and where violence has become the norm.

Gun violence is widespread, as weapons left over from the war remain in the hands of many former combatants who have now returned to their home provinces - and there is no border police force to stop criminals from across the continent from crossing the country's frontiers.

Even the airport in the capital, Juba, is not properly secure, and cattle rustling remains a huge ­problem among South Sudan's mostly rural population.

However, Kuol said there were similarities with a developed nation such as Scotland, where the police are part of the community as well as a national force.

He said: "I'm really amazed at how the partnership between ­communities and the police is ­working in Scotland. The only problem we have is that where policemen and women are conscious of their mission and work in their communities.

"But long ago in Scotland you had many clans all fighting each other, and that is the case in my country among the tribes. We have many communities, but they are fighting themselves and sometimes you get policemen and women taking sides with their tribe.

"We need to develop their minds and become conscious of their national duty, and should not look at their tribes but look at the national interest."

He added: "Peace in a community is better than fighting, but we have a long way to go. Like what happened here in Scotland - it took a long time for people to stop fighting among themselves.

"But if we can develop this, we will have community police who will be effective."

Getting to that point will be a challenge. With a national literacy rate of 60%, many of the General's officers are unable to file reports or keep accurate records.

Corruption also exists because there is no oversight from the institutions commonplace in the developed world. Establishing this is among the most urgent tasks facing the new country.

Kuol said: "Accountability is the most important thing in any organisation. Without it you cannot fight corruption and malpractice.

"What we are trying to create is an accountability system. I cannot say there is no corruption, because that system is not yet in place.

"But for the police to have value, trust and respect, we must make sure that the people have confidence in them, and that is my biggest challenge.

"We have to have a transparent system, and training is the key to that. My priority now is training and how to train my officers."

Retired Scottish police officers and their counterparts from elsewhere in the UK are also currently working with police in South Sudan as part of the Safety and Access to Justice project, funded by the Department for International Development.

A spokesman for the department said: ­"Britain is helping to train police officers in South Sudan, including by i­mproving their awareness of human rights.

"Through regular monitoring, we seek to mitigate risk and ensure that those who we train are not implicated in human rights abuses."