The Military Advocate General's (MAG) Corps developed from the legal service of the Hagana. Since the Hagan was a quasi-military hierarchal organization, it required rules and a code of discipline and a system through which it could be enforced. This requirement gave rise to the legal service in the Hagana. Courts were created and prosecutors and defense attorneys were appointed. Only a few members of the Hagana were given full-time appointments as prosecutors and were called general prosecutors and produced a manual named 'Prosecutorial Regulations'. In some fields they also compiled legal guides that included, amongst other areas, specifications for those holding judicial office and specifications for various offences.

Subsequent to the creation of the State of Israel and the formation of the IDF, a legal unit was created integrating the Hagana's Legal Services into the general military infrastructure. The Legal Services Corps was presided over by Advocate Avraham Gorali, who previously served as the Chief Prosecutor of the Hagana. The Corps was comprised of a prosecutorial unit, defense counsel unit, legal advice unit and a legal-aid unit for soldiers.

Alongside the legal service, a military justice system was also founded, with the Supreme Military Court established as the highest body of adjudication. Although the courts of first instance were part of the legal service, the Military Supreme Court was classified as a separate and independent entity.

In 1948, State of Emergency Regulations (Jurisdiction Law) were formulated that validated Israel's military judicial system. These regulations organized the army's legal institutions and specified various military offences. In this respect, they were a continuation of the Hagana's legal system. They were formulated by attorney Nahum Hut, the Ministry of Defense's legal advisor in cooperation with Aharon Hoter-Yishai, a well known lawyer in the Zionist settlements during the mandate period. He defended members of the Hagana in trials convened by the British, and served as the administrative officer of the 7th Armored Division upon the establishment of the IDF. The regulations dictated, that the army be divided into separate regional and legal jurisdictions.

A division or service commander stood at the head of each regional district. Consequently, each district had its own military prosecutor that headed the legal system of the district. In November 1948, the policy to separate judicial districts according to division was revoked and reorganized according to the different fronts that existed at that time. In principle, the divisions were geographical in nature, with separate judicial districts being created for the Navy and the Air Force, thus creating six defined legal districts. At the end of 1948, Aharon Hoter-Yishai replaced Avraham Gorali as the Chief Prosecutor. In 1949 the IDF Legal Service's Corps was renamed the Military Advocate General's Corps and the Chief Prosecutor title was renamed, the Military Advocate General.

On July 20th 1955 the Military Justice Act (MJA) was promulgated. Principle amongst its drafters, were Colonel Meir Zuhar (at the time head of the MAG Corps), Dr. Shlomo Parless and Meir Shamgar of the Military Advocate General. Following ratification by a Committee of Commanders headed by Major-General Joseph Avidor, it took effect after subsequent consultation with the Ministry of Justice.

The Military Justice Act (MJA) replaced the State of Emergency Regulations (Jurisdiction Law) and is the basis of all the legal bodies until this day. The Military Justice Act redefined the military legal institutions and military offences. It also laid down the procedural rules of the military courts and was considered to be quite advanced for its day. The Military Justice Act also transferred the courts of First Instance to the unit of the Supreme Military Court, and together they formed an entirely new Military Court Division.

A significant changed occurred in 1986, as the MJA was amended and now required that all judges be chosen through a selection committee, similar to the process of appointing judge in the civilian sector in Israel, and that the head of the Military Court of Appeals be a certified advocate.

Examining the history of the MAG Corps and the legal systems of the IDF demonstrates the differing tenets that stand at its base. On the one hand, the Anglo-American concept recognizes military law as a tool for instilling discipline within the ranks of the military, and that the commander is the head of the legal system. On the other hand, the European view recognizes that the law in and of itself is significant and that the military judicial system is independent from its commanders. With respect to the IDF's experience, in recent years we have seen a marked transition from the first to the second view being embraced as a more dominant model.

Throughout the years, the MAG Corps has dealt with a wide range of cases, such as the Tobeyansky and Kassam village affairs. In the latter, the legal standing of blatantly illegal orders was discussed.

The period of the Six-Day War, and thereafter was the finest hour of the MAG Corps. As a result of preparatory work in previous years, headed by the then MAG, Colonel Meir Shamgar, legal manuals were prepared for the officers of the MAG Corps and were subsequently followed by instructional lectures in International Law and subjects relating to the legal standing of territories conquered during war. When the IDF conquered territories during the Six-Day War' the officers of the MAG corps arrived equipped with all the proclamations that were necessary under international law. After the Six-Day War, a court and prosecutorial system and legal advice branches were established in the conquered areas.

During the Intifada, which lasted from the late 80's until the early 90's, the MAG Corps was required to address a broader array of issues, including the rules of engagement and conduct unbecoming of a soldier relating to the treatment of Palestinians in the territories.

Throughout the years the MAG Corps has served as an essential and integral part of the military, as it is charged with the fundamental task of enforcing the rule of law throughout the military and is intrinsically involved with advising the IDF at the operational level throughout all regions of Israel and in its military relations abroad.

Over the years, the MAG Corps has also addressed the subjects of the prosecution of commanders responsible for the injuries caused to soldiers, both during operational and training exercises. In recent years, there has been a noticeable rise in the involvement of the law in the military and the consequences thereof. Many units now frequently request legal advice on a variety of new subjects to meet the many challenges they face on a daily basis.