(Reuters) - A gay man who was denied a marriage license in Kentucky two years ago by a county clerk who refused to issue licenses for same-sex marriages will run to unseat her next year, he said on Wednesday.

David Ermold, of Morehead, Kentucky, announced his candidacy as a Democrat against Rowan County Clerk Kim Davis, who drew worldwide attention when she refused to grant the licenses to same-sex couples, citing Apostolic Christian beliefs.

Ermold and his partner were one of the four couples who sued Davis.

“We need to restore the integrity of that office,” Ermold said in a phone interview with Reuters after his campaign announcement on Facebook. “I wasn’t treated fairly myself.”

Davis intends to seek re-election as a Republican in 2018. She said in an email on Wednesday that she helped Ermold with his candidacy paperwork.

“I shook his hand and told him ‘Congratulations and may the best candidate win,’” Davis said.

Davis spent five days in jail in September 2015 after refusing a court order to issue marriage licenses following the Supreme Court’s decision legalizing same-sex marriage.

Slideshow ( 2 images )

Her case in 2015 drew hundreds of protesters and supporters to her office in Morehead, in rural eastern Kentucky. While she was in jail, then-Republican presidential candidates Mike Huckabee and Ted Cruz visited her.

Less than a month after she was released from jail, Davis, who won election to the office in 2014 as a Democrat, switched her affiliation to the Republican Party.

After her case, Kentucky lawmakers removed all county clerks’ names from the state marriage license form.

Ermold and David Moore obtained a license and were wed on Sept. 26, 2015, Ermold said. The couple had a wedding ceremony the following month.

“We need someone who is going to stay focused on our community instead of focusing on the interests or agendas of outside organizations and politicians,” Ermold said.

In October 2017, Davis and a Liberty Counsel representative traveled to Romania, where those opposing same-sex marriage sought a referendum on the issue, to meet with religious and political leaders.