US election: How does a contested convention work?
Texas Senator Ted Cruz has won a decisive primary contest in Wisconsin, hurting front-runner Donald Trump's chances of securing the Republican nomination before the party's summer convention.
That means the nominee could be picked at a so-called contested convention in the summer.
What does that involve?
Why would a contested convention happen?
Delegates are accumulated by each candidate according to the votes held at the primary contests in each state. They represent their states at the party's convention in July, which is usually a coronation of the chosen nominee. This year it takes place in Cleveland, Ohio from 18-21 July.
But a contested convention would happen if no candidate reaches the 1,237 delegates needed to secure the nomination.
Donald Trump needs to win more than 60% of the remaining delegates to hit that magic number, Ted Cruz needs to win more than 90% of the remaining delegates. John Kasich cannot mathematically reach it.
It has not happened for the Republicans since 1976, when Gerald Ford did not have enough delegates before the convention to get the nomination. The last time a contested convention produced a candidate who went on to win in the general election was in 1932 with Franklin Roosevelt.
How does the process work?
Selecting the actual delegates who will attend the convention is an ongoing process, completed at county and state conventions.
Usually, delegates are bound to vote for the candidate they were already pledged to on the first ballot at the convention, and a consensus emerges for a nominee.
If there is no winner on the first ballot, there will be a second and a third and so on until there is a clear winner. That is when "floor fights" can happen and back-room deals can be cut in Cleveland.
The wheeling and dealing has already started, with Ted Cruz's team trying to persuade delegates who have been chosen that they should vote for him on the second ballot.
Mr Trump's campaign has complained about how delegates were chosen in Louisiana. He won the primary, but may end up with less delegates than Ted Cruz because of the state's five unbound delegates who can vote for whichever candidate they want.
Cruz supporters have also taken up five of six slots on committees that write the rules of the Republican National Convention, the Wall Street Journal reports.
Is a contested convention fair?
Some would say it's undemocratic, because Trump could lose out even though he got the most votes.
A staunch Trump ally, Roger Stone, has threatened to send Trump supporters to the hotel rooms of delegates who switch allegiance.
A majority of Republicans believe he should get the nomination if he has the most delegates, according to a McClatchy-Marist poll released on Tuesday.
But John Kasich argues that the delegates are honourable people who should be allowed to decide the outcome.
Could someone who didn't run win the nomination?
Yes, if the Republican national committee suspends its rule (Rule 40) that only candidates who have won eight states can be nominated.
Republicans have been floating House Speaker Paul Ryan's name, but he has said this week he will not be running for president.
Former Republican presidential candidate Mitt Romney has expressed willingness to be the nominee if chosen at the convention.
"I don't think anyone in our party should say, 'Oh no, even if the people of the party wanted me to be president, I would say no to it.' No one is going to say that," Mr Romney told NBC last month.
Former Texas Governor and Republican presidential candidate Rick Perry also said he would not rule out being the nominee.
In 1952, when Adlai Stevenson won the Democratic nomination, he was the governor of Illinois and had no plans to run for president.
What happens to Marco Rubio's delegates?
Different states have different rules for where Mr Rubio's delegates will go, and so far, Mr Rubio has said he wants to keep all 171 of his delegates, despite having dropped out of the race.
It's a very complicated picture.
Mr Rubio's five delegates from Alaska were divided between Mr Trump and Mr Cruz by the state party, but Mr Rubio wrote to the party and asked for them back.
In Oklahoma, Mr Rubio has not formally released his delegates, and in Minnesota, his 17 delegates will be free to back the candidate of their choice at the convention.
All three remaining Republican candidates are clamouring for Mr Rubio's delegates, but it is yet to be seen who they will end up boosting or hurting come July.
Could John Kasich win the nomination?
If the party upholds a rule that requires the nominee to have won at least eight state primary contests, Mr Kasich would almost certainly be cut, because he has only won his home state of Ohio so far.
Despite that, he has said repeatedly on the campaign trail that he could get the nomination in a contested convention because of his experience and electability against Democratic front-runner Hillary Clinton. Both Mr Trump and Mr Cruz have urged him to drop out so they can have his delegates.