The Republican candidate for Cumberland County district attorney has withdrawn from the race.

Randall Bates, a defense attorney from Yarmouth, announced the decision Tuesday in a news release.

“It was a difficult decision, made after careful consultation with my family,” Bates said. “I realize that this will be disappointing to all those good people who encouraged me to run in the first place, but it is just not the right time for me to take this step.”

Bates said he will continue his work as a defense attorney, and he thanked his supporters. With his departure, two candidates remain in the race to replace outgoing District Attorney Stephanie Anderson. They are Democrat Jon Gale and independent Jonathan Sahrbeck. Gale is a defense lawyer and former prosecutor, and Sahrbeck is currently a prosecutor in the District Attorney’s Office.

“There are two fine candidates remaining and I know that either will serve the citizens of Cumberland County well,” Bates said.

Bates’ name will still appear on the Nov. 6 ballot because the deadline had passed for candidates to withdraw and have their names removed.

Anderson is not seeking re-election. She was the first woman to hold the job when she took office in 1991, and she is currently serving her seventh term.

The American Civil Liberties Union of Maine, the League of Women Voters of Maine and the Westbrook Community Center are hosting a candidate forum for the race Thursday. The candidates will appear at the Westbrook Community Center at 7 p.m.