The walkout was a rare protest by diplomats on the UN's most powerful body against one of their own members. Libya is the only Arab representative on the council.
According to several diplomats, Ibrahim Dabbashi, Libya's deputy UN ambassador, ended a long speech about the plight of the Palestinians by comparing the situation in Gaza to the concentration camps set up by Nazi Germany to exterminate Jews.
About six million Jews and up to 500,000 Gypsies were killed during the Nazi Holocaust.
Immediately after Dabbashi mentioned the concentration camps, envoys of France, the United States, Britain, Belgium and Costa Rica walked out of the council's consultation room, diplomats said.
Dumisani Kumalo, South Africa's UN ambassador and the current council president, then ended the meeting.
Kumalo told reporters that members "could not agree" on the statement.
He said that some members wanted the council to address the humanitarian situation "which is horrible" while others insist on including the underlying political and security issues.
"A number of council members were dismayed by the approach taken by Libya and do not believe that such language helps advance the peace process."
"We support the South African presidency's decision to close the meeting," Britain's deputy ambassador Karen Pierce said in a statement.
Bashar Ja'afari, Syria's UN ambassador who is not a Security Council member, told reporters afterwards that he agreed with Libya's characterisation of the situation in Gaza.
"Unfortunately those who complain of being victims of genocide [during World War II] are repeating the same kind of genocide against the Palestinians," Ja'afari said.
Al Jazeera's John Terrett said that Arabs delegations to the United Nations "feel that each time there is an attempt to raise the issue of what is happening to the Palestinians in Gaza, it is somehow blocked by the Americans who are Israel's main ally on the council.
"The Arab delegations say they would do what they have to do and come back time and time again either to the Security Council or if it needs be to the General Assembly to try get the United Nations to take a formal stand on the plight of the Palestinians.
"In the meantime, the president of the Security Council ambassador Kumalo of South Africa says there will be an attempt to raise the issue in the coming days in the Security Council again."
Israel has greatly restricted the flow of goods into Gaza since Hamas seized control last June.
It has further tightened the blockade in recent weeks in response to heavy fighting. Israel considers Hamas a terrorist group.
In previous months, the council had several times tried and failed to agree on a statement regarding the crippling Israeli siege of Gaza in response to rocket fire from Palestinian groups based in Gaza.