The Office of the Attorney General can be traced back to 14th August 1832 when by means of Proclamation No. VIII of that same year, issued by Governor Sir Frederick Cavendish Ponsonby, Robert Langslow was appointed as His Majesty’s Attorney General of Malta. The Attorney General had the role of the legal adviser of the Government and ex officio General Magistrate. Mr Langslow was assisted by Dr Emanuele Caruana together with Dr Benedetto Bardon, who were appointed King’s Counsels for the Island of Malta and its dependencies and by Dr Odoardo Dingli, who was appointed King’s Counsel for the Island of Gozo. The Office was short-lived as in 1838, in consequence of a report of a Royal Commission sent out to inquire into the judicial establishment of Malta, the British Government abolished the Office altogether.

By means of Proclamation No I of 1839, the Office of the Attorney General was replaced with that of the Office of the Crown Advocate. This Office immediately left its mark as it was entrusted to draft the much controversial freedom of the press legislation. Dr Giacomo Pantaleone Bruno served as Malta’s first Crown Advocate (1839–1842), only to be followed by a string of brilliant and intelligent lawyers such as Dr Antonio Micallef (1842–1853), Sir Adrian Dingli (1854–1880), who authored more than 200 pieces of legislation, Sir Giuseppe Carbone (1880–1894), Dr Alfredo Naudi (1895–1905), Sir Vincent Frendo Azzopardi (1905–1915), Sir Michelangelo Refalo (1915–1919) and Sir Arturo Mercieca (1919–1921).

Through the 1887 Letters Patent, which constituted a Council of Government, the Crown Advocate became involved in Government’s political process. However, in 1921, following the advent of responsible Government in Malta, the Office of the Crown Advocate acquired a dual role. The Office was renamed as ‘Public Prosecutor and Treasury Counsel’ with Major Victor Frendo Azzopardi being nominated as the first Public Prosecutor (1921–1928), followed by Sir Philip Pullicino (1928–1936). As the legal advisor of the Maltese Government, the Public Prosecutor was entrusted with criminal law matters while the Treasury Counsel was responsible for civil matters. The Office was also responsible for legislating on transferred matters.

In 1936, Governor Sir Charles Bonham-Carter redesignated the Office through the Attorney General (Constitution of) Office Ordinance (No. XXX). The Ordinance also sought to create new roles within the Office, i.e., that of the Deputy Attorney General and the Senior Counsel. The Attorney General absorbed the functions previously vested in predecessors, namely public prosecution and legal advice to Government.  The designation of Assistant Attorney General was introduced by Act XXIV of 1956.

Sir Philip Pullicino (1936–1940), Dr Louis Naudi (1941–1955), Sir Anthony Mamo OBE QC (1955–1957) and Professor John J. Cremona (1957–1965) served as Attorney Generals within the redesignated Office up to the grant of the Independence.

In 1964, the political independence of the Attorney General was consolidated through the entrenchment of the Office in the Constitution of Malta. The Constitution provides that in the exercise of duties, the Attorney General has powers to institute, undertake and discontinue criminal proceedings and is not subject to the direction or control of any other person or authority. Malta’s supreme law also guarantees the Attorney General the security of tenure as provided to members of the judiciary.

Under Legal Notice 46 of 1965, the designation Attorney General was changed to Crown Advocate General. Act XVIII of 1971 bestowed the same powers and privileges enjoyed by the Crown Advocate General to the Deputy Crown Advocate General, the Senior Crown Advocate General and the Crown Counsels. Dr Michele Tufigno (1965–1971) and Dr Edgar Mizzi (1971–1981) served as Malta’s Crown Advocate Generals.

In 1974, the designation was again changed as the Crown Advocate General became known as the Attorney General. In 1975, the Senior Crown Counsel and the Crown Counsel became known as the Senior Counsel of the Republic and the Counsel of the Republic, respectively. In 1988, under Act XVII, the Senior Counsel for the Republic became known as Assistant to the Attorney General. In 2004, the Office of the Attorney General became an Agency of Government endowed with legal personality.

The following lawyers served as Attorney Generals since 1971: Dr Edgar Mizzi (1971–1981), Dr Victor Borg Costanzi (1981–1983), Dr Joseph G. Borg (1983–1988), Dr Carmel Testa (1988–1989), Dr Anthony Borg Barthet (1989–2004), Dr Silvio Camilleri (2004–2010) and Dr Peter Grech (2010–2020).

In 2019, the dual role of the Attorney General as Public Prosecutor and Principal Legal Counsel to the Government came to an end when the Office of the State Advocate was constituted to be responsible for civil, constitutional, and administrative law. The Office of the Attorney General became a specialised prosecution service.

Dr Victoria Buttigieg (2020–present) is the first woman nominated as Attorney General and the first to head the Office in this specialised role of taking decisions to prosecute and conducting prosecutions before the Court of Magistrates.