There weren’t any elves or magical warlocks present, but this fantasy-inspired election tiebreaker was still one for the ages.

A tied California vote was decided in unusual fashion when the candidates rolled a 20-sided ‘Dungeons & Dragons’ die to determine the winner, as seen on a tense Facebook livestream last week.

“The statute says when we have a tie that the winner is determined by lot,” Assistant County Registrar Scott Konopasek says in the video. “It doesn’t say what kind of lottery to use, so we’ve been kind of creative here.”

Konopasek said that someone in the office happened to have a Dungeons & Dragons die lying around — so they used it, according to gaming site Polygon.

Prior to the fateful roll, each candidate for the office of Byron-Bethany Irrigation District Director 1 had received a total of 51 votes.

Both competitors were given three rolls, with the candidate with the highest total declared the winner.

The die-rolling drama had reached a fevered pitch when the incumbent, Larry Enos, shattered the near-tie with a 20 on his final roll.

Enos was amused by the circumstances surrounding his victory. “This is a little different — not what I expected,” Enos said, according to Bay Area News Group. “I was expecting a coin toss.”

The election video has been viewed more than 2,000 times online, with users commending the elections officials for their ingenuity.

“If this agency has the need for a bigger and fancier [Dungeons & Dragons die] let me know, I’d be happy to help,” one Facebook user wrote.