BUENOS AIRES — President Mauricio Macri of Argentina was unexpectedly trounced in primary elections, suggesting that voters angered over his austerity measures and the country’s deep recession and soaring inflation are inclined to put their faith in his leftist opponents.

Mr. Macri looked ashen late Sunday night. Polls had predicted a tight race, but he received 32 percent of the vote, lagging 16 points behind the ticket in which the country’s former president and a political powerhouse, Cristina Fernández de Kirchner, is running as vice president with a little-known presidential candidate.

In Argentina, primaries are used to ensure candidates have enough support to contend in the general election. Both tickets will be able to participate based on their performance Sunday, but the primary gave a sense of how far behind Mr. Macri has fallen.

“We had a bad election,” Mr. Macri told supporters in Buenos Aires as he vowed to “redouble efforts” to win back support before the presidential election in October.