The state attorney general in each of the 50 U.S. states and territories is the chief legal advisor to the state government and the state's chief law enforcement officer. In some states, the attorney general serves as the head of a state department of justice, with responsibilities similar to those of the United States Department of Justice.
The attorney general gets voted in.