I was the United States Attorney for Maine for three years, and then was appointed a federal judge.
or simply: