It is normally the stuff of political daydreams, but this year's Republican nominating convention in Cleveland has the potential to be the first contested affair in half a century.
Here's how it works.
For starters, brokered conventions — also referred to as contested or open conventions — used to be the norm in America's early days, before the primary process was put in place. Delegates from every state for both parties would gather and debate which candidate their party should nominate. At times, it could be a grueling process.
The award for the longest deadlock goes to the Democrats in 1924. That year, delegates had to vote 103 times before settling their intrasquad dispute. The party, deadlocked over Prohibition, eventually failed to nominate either primary candidate Alfred Smith or William McAdoo and finally settled on dark horse John W. Davis, Woodrow Wilson's ambassador to the United Kingdom, as a compromise for their nominee.
Political conventions are only considered contested if no candidate arrives with an outright majority of delegates. In this year's GOP race, that is a possible scenario. Donald Trump has dominated the campaign so far, but a diverse field of candidates, led by Sen. Ted Cruz, have won enough delegates so far that Trump could arrive in Cleveland without the 1,237 delegates needed to win outright when the first ballots are cast.
This is where it could get complicated.
There are two kinds of delegates at a party convention. The first is a pledged delegate, which candidates secure by winning a primary, or by finishing with a high enough percentage of the statewide vote. Those delegates are bound by party rules to vote for their candidate on the first ballot — and normally the presumptive nominee has more than enough of them to claim the nomination free of any drama. There are also super delegates and a small number of uncommitted delegates who are appointed by party officials and are free to back any candidate of their choosing. For Republicans, there are relatively few of these delegates — about 5 percent of the overall number.
But in a razor-thin race in which multiple candidates come into the convention with the hope of winning the nomination, super delegates could prove decisive.
So far, the likeliest outcome in the GOP race is that Trump, the front-runner, will lock up the 1,237 delegates needed in the race. It would take a late surge for either Cruz or Ohio Gov. John Kasich — or both — to deny Trump the nomination.
However, there is still a mathematical possibility it could happen, especially considering Trump has largely failed to grow his percentage of the vote as the field of Republican candidates has narrowed. The vast majority of Trump's victories so far have been pluralities, not majorities. If that were to continue, it could cause h im to fall short of the magic number.
If that happens, the second ballot in Cleveland could go in any direction. With delegates free to support anyone after the first ballot, the party could turn to someone who hasn't even been in the race so far.
If the party turns to a non-candidate, it's known as being nominated "from the floor" — as in, from the floor of the convention hall, rather than through the electoral process.
The idea isn't as far-fetched as it sounds.
Former House Speaker John Boehner on Wednesday said if no candidate arrives with 1,237 delegates, he would support his successor, House Speaker Paul Ryan, to become the party's nominee to avoid a bruising fight between candidates and their supporters on the convention floor.
The likelihood of a brokered convention is still most likely political fiction. But as the NBC drama The West Wing demonstrated, it can be pretty good political fiction. The show's final season featured a brokered Democratic convention to succeed a hamstrung President Josiah Bartlet, played by Martin Sheen.
Watching his fellow Democrats scratch and claw their way through multiple ballots, a frustrated Bartlet turns to his wife and deadpans, "I think Aaron Burr has 10 votes."