The existence of armed forces commanded by the elected government of a nation is a hallmark of democratic rule. Before the establishment of the State of Israel in May 1948, there were a number of armed Jewish defense organizations that operated for its protection. In addition to the Haganah and Palmach, which answered to the elected leadership of the Jewish national institutions, other armed defense group including the Lehi (Lohamei Herut Israel or 'Fighters for the Freedom of Israel') and the IZL (Irgun Zevai Le'ummi or 'National Military Organization') operated independently.
It was only natural that when Israel's independence was declared, the new legal government would decide to establish a single, unified armed force loyal to the Government of the State of Israel: The Israel Defense Forces.
On May 28, 1948, the Provisional Government of the State of Israel issued Defence Army of Israel Ordinance No. 4. This ordinance, signed by Prime Minister David Ben-Gurion, established the Israel Defense Forces, which would be comprised of "land forces, a navy and an air force". The ordinance was published in the Official Gazette No.3 of May 31, 1948 (below in English and Hebrew).
In a state of emergency, conscription would be instituted and the age for conscripts would be set by the Provisional Government. The existence or establishment of any armed force other than the Israel Defense Forces was prohibited. Additionally, every individual serving in the IDF would be required to swear allegiance to the State of Israel, to its laws, and its legal bodies.
The general officers of the nascent Israel Defense Forces were sworn-in in a ceremony conducted on June 27, 1948.
The process of establishing a unified Israel Defense Forces was protracted. It began in the midst of the fighting against invading Arab armies. The Lehi resistance organization dissolved itself immediately upon the creation of the State of Israel and its members joined the IDF on an individual basis. However, in the Jerusalem area, the Lehi continued to function as an armed fighting force until 17 September 1948, when the organization in that sector was dissolved according to a government order issued after the assassination of the UN mediator Count Folke Bernadotte.
Individual battalions of the IZL joined the IDF with the exception of those fighting in Jerusalem. However, following the Altalena incident, these battalions were disbanded on September 20, 1948, and their soldiers joined the IDF on an individual basis as did all other citizens of the State of Israel.
The companies and battalions of the Palmach joined the IDF in a process which extended until the Chief of Staff ordered the dissolution of the Palmach on 29 October 1948, which became effective on 7th of November.
The creation of a unified IDF lasted almost 6 and a half months, from May 28 until November 7, 1948.