MOUNT VERNON, Iowa — Hillary Rodham Clinton says that jail was the “right thing” for a Kentucky clerk who refused to issue marriage licenses to same-sex couples.

Speaking in Iowa Wednesday, the Democratic presidential hopeful said Rowan County Clerk Kim Davis was “treated as she should have been treated.”

Davis spent five days in jail for defying a court order and refusing to license gay marriages. Several Republican presidential candidates have vocally defended Davis, including former Arkansas Gov. Mike Huckabee and Texas Sen. Ted Cruz.

“People are totally entitled to their private, personal beliefs, religious or otherwise, but when you take an oath to uphold the Constitution of the United States, that is your job,” Clinton said, adding that people are free to agitate to seek to change laws.

Clinton spoke before more than 700 people at Cornell College in Mount Vernon, Iowa, as part of a two-day swing through the leadoff caucus state. She also pledged to fight for gun control measures, seek immigration reform and defend the Affordable Care Act.

Clinton also criticized the Republican primary field, saying the rhetoric in that contest was reaching a “new low.”

“I think we all have to speak up and speak out when they say things,” Clinton said. “I’ve gone very clearly after the comments that not just (frontrunner Donald) Trump, but some of the others have made.”