BUENOS AIRES — The governing coalition of President Mauricio Macri of Argentina won decisive victories in key districts across the country in midterm elections Sunday that were widely seen as a referendum on the center-right leader’s first two years in office.

The election sweep strengthens Mr. Macri’s ability to carry out economic changes he says are necessary to improve the country’s economy, and the results automatically position him as a candidate for re-election in 2019.

In the closely watched province of Buenos Aires, where the Senate candidate aligned with Mr. Macri, Esteban Bullrich, faced off against Mr. Macri’s predecessor and political rival, former President Cristina Fernández de Kirchner, the governing coalition won by four percentage points.

“Today, the winner wasn’t a group of candidates nor a party. Today the winner was the certainty that we can change history forever,” a beaming Mr. Macri said at his campaign headquarters before he danced on stage alongside his wife, Juliana Awada, and key members of his coalition.