At least 36,000 people have been displaced as a result of the fighting that has flared in the South Sudanese capital Juba in recent days, according to the UN refugee agency.

At a news briefing in Geneva on Tuesday, the UNHCR representatives called on armed parties to protect civilians and demanded neighbouring countries keep their borders open for people fleeing from the violence.

"Inside South Sudan, some 7,000 internally displaced people have sought shelter in the UN's bases in Juba," said spokesman Leo Dobbs.

"Providing them with food, shelter, water, hygiene and sanitation facilities will remain a critical challenge so long as the security situation remains bad."

The agency noted that security at the Uganda-South Sudan crossing had been tightened, restricting the number of individuals crossing to seek asylum.

READ MORE: South Sudan crisis - Renewed fighting in Juba

"Just 95 people crossed on Saturday, dropping to 36 on Sunday, compared with a daily average of 167 for July and 171 for June," said Dobbs.

"Those that have managed to cross have reported indiscriminate attacks against civilians, with buses from Juba to the Uganda border being stopped and robbed."

Fighting broke out between troops loyal to rival leaders President Salva Kiir and Vice President Riek Machar on the eve of the five-year-old country's independence anniversary last week, killing hundreds of people.

A ceasefire order was announced by Kiir on Monday and was quickly reciprocated by Machar.

"It has been relatively calm after the ceasefire was declared. But people don't know how long this ceasefire will hold. And they prefer to sleep at UN compounds in case of attacks," Al Jazeera's Haru Mutasa, reporting from Wau in the northwest of Juba, said.

READ MORE: S Sudan - Al Jazeera meets Salva Kiir and Riek Machar

South Sudan overwhelmingly voted to break away from Sudan in a referendum in 2011.

The country descended into civil war in 2013 after Kiir accused Machar, his former deputy who he had sacked earlier that year, of plotting to overthrow him.

Soldiers from Kiir's Dinka ethnic group clashed with troops loyal to Machar's Nuer ethnic group, leaving tens of thousands of people dead in the conflict that followed.

A peace agreement in August 2015 saw Machar rejoin the government as vice president.