Viewers will get to vote in real time for one of three endings of an upcoming episode of "Hawaii Five-0," CBS said Thursday.

"I've always felt the most fun aspect of watching a mystery is trying to figure out 'whodunit,'" executive producer Peter Lenkov said in a statement.

"Now the 'Hawaii Five-0' viewers will actually get the chance to tell us who they think committed the crime and we will listen. I love that our dedicated and attentive fans will actually play a part in resolving our story."

CBS said this will be the first time in television history, a prime-time drama will allow viewers to choose the ending of an episode in real time.

Votes will be cast through and Twitter during the episode's East and West Coast airings Jan. 14.

The tropical island-set cop drama stars Alex O'Loughlin, Daniel Dae Kim and Scott Caan.