Shamgar (born August 13, 1925) was born in the city-state Danzig (modern-day Poland) to Eliezer and Dina Sterenberg. In 1939, at the age of 14, Shamgar emigrated to Mandate Palestine and joined the Etzel, one of the Jewish defense organizations working against the British.
In 1944, Shamgar was arrested for taking part in Etzel activities and was deported to Eritrea. While in prison, Shamgar studied law by correspondence with the University of London and later completed studies in history and philosophy at the Hebrew University of Jerusalem.
From 1961 to 1968, Shamgar served as Military Advocate General and from 1968 to 1975 he worked as Attorney-General of Israel. In 1975, Shamgar was appointed to sit as a justice on the Israeli Supreme Court and from 1983 to 1995 he served as President of the Supreme Court.