In 1998, Ayotte joined the office of the New Hampshire Attorney General as a prosecutor.
As assistant attorney general, Ayotte prosecuted two defendants for the 2001 Dartmouth College murders in Etna, New Hampshire.