The UN mission in South Sudan condemned the "unprovoked attack" and called for a full investigation into the "heinous murders."
The attackers forced their way into a camp in Bor in Jonglei state where some 5,000 ethnic Nuers have sought safety since fighting in South Sudan broke out in mid-December.
"The assailants, a mob of armed civilians, came to the base under the guise of peaceful demonstrators intending to present a petition ... The armed mob forced entry on to the site and opened fire on the internally displaced persons sheltering inside the base," said UN spokesman Stephane Dujarric, at UN headquarters in New York.
"The violent attack happened despite repeated warning shots fired by UN peacekeepers. The armed mob forced entry onto the site and opened fire on the internally displaced person sheltering inside," the UN said.
Also Read
Bor has changed hands four times between the military and rebels. The rebels back former Vice President Riek Machar, a Nuer who was fired from his office in July by President Salva Kiir, an ethnic Dinka.
Ian Hughes, Britain's ambassador to South Sudan, said on Twitter that the attack was an "outrage."
"Internally Displaced People must be protected. Prospect for copycat attacks worrying," he wrote.
Fighting this week broke out in Unity state with anti-government forces taking control of Bentiu, while intense clashes were reported in Renk, north of Malakal in Upper Nile state.
Perry Mansfield, who heads aid group World Vision in South Sudan, said his group's Renk staff were caught in the crossfire and could not safely access the UN base.
The violence has forced more than 1 million people in South Sudan to flee their homes. The planting season is under way but few are farming.