The Jan. 14 episode will for the first time allow viewers to select the ending of an episode via popular vote.

CBS' Hawaii Five-0 is prepping a television first.

The Jan. 14 episode will allow viewers to select how the hour of the cop drama ends, using real-time voting via CBS.com and Twitter during the broadcasts in both the Eastern and Western time zones, the network said Thursday.

In the episode, the team will investigate the death of an Oahu State University professor, with his boss, teaching assistant and a student he busted for cheating among the viable suspects.

STORY: 'Pretty Little Liars' Actress Heads to 'Hawaii Five-0'

After all of the suspects' motives are revealed, viewers can head to CBS.com or Twitter to select one of three options: #TheBoss, #TheTA or #TheStudent. Votes will be tallied immediately during the episode, and the most popular ending will become part of the broadcast during both the East and West broadcasts. All three endings will be available on CBS.com following the broadcast.

"I've always felt the most fun aspect of watching a mystery is trying to figure out whodunit," executive producer Peter Lenkov said of the effort, a first for a primetime TV drama. "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."

Hawaii Five-0 airs at 10 p.m. Mondays on CBS.

Email: Lesley.Goldberg@thr.com; Twitter: @Snoodit