Conservative Argentine President Mauricio Macri suffered a resounding defeat in primary elections on Sunday.
The primary, in which presidential candidates from all parties take part, was won by his left-wing rival, Alberto Fernández.
Mr Macri, whose austerity measures have turned many voters against him, is hoping to win a second term in office in the presidential poll on 27 October.
But analysts say his chances of beating Mr Fernández now look very slim.
How do the primaries work?
Voting in the primaries is compulsory and is not restricted to party members but open to all those eligible to cast their ballot in the presidential polls. Whoever wins is therefore seen as a favourite for the presidential polls on 27 October.
The primaries were introduced in 2009 to cut down on the number of candidates running in the presidential elections with contenders having to win a minimum of 1.5% to be eligible to stand for the presidency.
What was the outcome?
With more than 95% of votes counted, the coalition backing Mr Fernández had 47.7% of the votes and that supporting President Macri had 32.1%.
Third was centrist former economy minister Roberto Lavagna with 8.2%. The remaining candidates all had less than 3%.
The result is seen as a rejection by voters of the harsh austerity measures introduced by President Macri in an effort to stabilise Argentina’s battered economy.
Argentina is in a recession and has one of the highest inflation rates in the world. The local currency, the peso, lost half of its value against the dollar last year.
While inflation has come down in recent months from a high of 57.3% in May, this seems not to have translated in support for President Macri’s policies.
What does it mean for the election?
If Mr Fernández were to get the same percentage or more of votes in the presidential election on 27 October, he would win it outright, without the need for a second round.
Under Argentine election rules, if a candidate wins at least 45% of the vote or gains 40% with a 10-percentage-point lead, that candidate is declared the outright winner.
If there is no outright winner, a second round will be held on 24 November pitting the top two candidates against each other.
Who is Alberto Fernández?
The 60-year-old lawyer is a member of the main opposition coalition, Frente de Todos.
His candidacy for the presidency came as somewhat of a surprise as former president Cristina Fernández de Kirchner – to whom he is not related – had been widely tipped to be the opposition coalition’s candidate for the top office.
But in May she announced in a video posted on social media that she had “asked Alberto Fernandez to lead a team that includes both of us, him as the presidential candidate and me as candidate for the vice position”.
While Mr Fernández served as cabinet chief both under Ms Fernández and her husband and predecessor in office, Néstor Kirchner, he does not have the same name recognition as his more famous running mate.
Mr Fernández’s relations with his running mate have been rocky in the past. After leaving her administration in 2008. Mr Fernández became a vocal critic of his former boss but he later dismissed their disagreements as “what happens to many Argentines, that you fight among friends because you disagree over politics”.
What has the reaction been?
Mr Fernández celebrated his success by stressing his commitment to change. “We are confident that Argentina needed to end with this chapter and start another page. I am confident that today Argentines have started to write another story,” he said after the results were announced.
President Macri said that he “recognised” that he had had a “bad election” and that he would “redouble” his efforts to gain the support he needs to win the presidential election in October.
Many investors see Mr Macri as a safer bet than Mr Fernández and stock prices are expected to drop once financial markets open.