A Tea Party officer and two others representing the challenger in a Senate primary became trapped in a courthouse in the middle of the night, hours after officials had gone home from counting votes, authorities said.

Janis Lane, Scott Brewster and Rob Chambers were locked inside the Hinds County Courthouse more than an hour after entering shortly before 2 a.m. Wednesday through an unlocked door, said Othor Cain, spokesman for the sheriff's department, which is investigating.

Noel Fritsch, spokesman for candidate Chris McDaniel, said the three went to check on why some precincts hadn't been counted. Once inside, the door locked behind them and they had to call for help to get out. Other elections officials had locked up equipment and ballots and gone home around 11:30 p.m.

Lane is president of the Central Mississippi Tea Party and is a longtime supporter of McDaniel, who is trying to unseat six-term Republican Sen. Thad Cochran.

The McDaniel-Cochran race is going to a June 24 runoff because a third candidate received a small share of Tuesday's primary vote, preventing either of them from receiving the majority needed to win.

Brewster works as coalition director for the McDaniel campaign. Chambers works for the lobbying arm of the Mississippi Baptist Convention. Lane, Brewster and Chambers did immediately not return calls for comment.

Hinds County Republican Executive Committee Chairman Pete Perry, who's supporting Cochran, said Lane called him at 2 a.m. Wednesday, saying she and a friend were locked inside the courthouse, that nobody else was inside and they needed help getting out.

Perry said Lane, who is on the GOP county committee, told him that when she was trying to get into the courthouse, she spoke to a man she believed was a police officer and that he showed them a door that appeared to be ajar.

Perry said he called the Hinds County Sheriff's Department. Cain, the department spokesman, said a deputy sent someone to let Lane, Brewster and Chambers out of the locked building.

"I told the deputy: 'I hope you don't just let her out. I hope you ask her what she was doing there,'" Perry told the AP.

Fritsch said nothing improper happened.

"Predictably, a close Cochran ally wants to make hay out of this," Fritsch said. "Sadly, the Cochran campaign wants to make this election about anything but issues."

The sheriff's department is interviewing people about what happened, Cain said. He said the courthouse had been closed at 11:30 p.m. and ballots and voting machines were locked up when the three were alone in the courthouse. An initial investigation showed nothing appeared to have been altered, he said.