 In June 2004, Governor Benson appointed Ayotte as Attorney General of New Hampshire, after the resignation of Peter Heed.She became the first and only woman to serve as New Hampshire's Attorney General, serving from 2004 to 2009, after she was twice reappointed by Democratic governor John Lynch.In July 2009, Ayotte resigned as Attorney General to pursue a bid for the U.S. Senate, after three-term incumbent Judd Gregg announced his retirement from the Senate.