A minister in the government of South Sudan was shot dead inside his ministry on Wednesday, days after referendum results confirmed the region will become Africa's newest independent state, officials said.

Final results of a referendum on independence confirmed on Monday that South Sudan will become the world's newest state on July 9. The region waged a decades-long civil war with Sudan's north which ended with a peace deal six years ago.

South Sudan's army spokesman Philip Aguer said the Minister of Rural Development and Cooperatives, Jimmy Lemi, was shot dead inside his office in the heart of the region's capital Juba.

(The attacker) also killed a guard at the door of the ministry, he said.

South Sudan's Interior Minister Gier Chouang Aloung said the attacker was the minister's brother in law. We want to make very clear there is no political motive whatsoever...it is a family issue... he was killed by his own brother-in-law.

Both officials said the attacker was under arrest.

It is very unfortunate, we are two days into the declaration of the referendum results which brought the south onto the list of independent states in the world, Aloung said.

One government source said the brother-in-law used to be a ministry driver but was sacked and thought he was owed money.

Officials said Lemi was a former member of the National Congress Party which dominates the north, who had defected to the south's ruling Sudan People's Liberation Movement ahead of April 2010 elections.

Security forces had cleared away hundreds of onlookers from around the ministry. A government car with a window smashed was parked inside the building compound.

We...saw a man taking a gun out of the car -- he ran inside and we heard three or four shots, said one witness.

An ambulance moved slowly away from the scene in a funeral procession, followed by dozens of wailing mourners.

South Sudan's Presidency declared three days of mourning.

Violence in the south remains persistent since the end of the north-south civil war. An estimated 3,000 people were killed in ethnic battles and tit-for-tat cattle raids in 2009 alone, although clashes had subsided ahead of the January referendum.