After five terms as Cape and Islands district attorney, Michael O’Keefe announced Wednesday he would not seek a sixth term of office.

“It has been the honor of my professional life to have been elected five times by the voters of the Cape & Islands and to have led an office of professional and dedicated prosecutors,” Mr. O’Keefe wrote in a statement. “After much reflection I have decided not to seek a sixth term as district attorney.”

Mr. O’Keefe credited support staff, victim witness assistants and police with his office’s effectiveness. He plans to finish serving the current term, ending next January.

Mr. O’Keefe began serving as district attorney in 2003.

“To the voters I say a heartfelt thank you for placing your trust in me over these many years,” he said in the statement.