(Adds month-to-month data, election context, analyst quote)
BUENOS AIRES, Aug 21 (Reuters) - Argentina's economic activity grew 3.8 percent in June compared with the same month a year earlier, government data showed on Friday, marking its biggest monthly increase in at least 18 months and beating economists' expectations.
Economic activity in Latin America's third-biggest economy is gathering pace as outgoing President Cristina Fernandez steps up public spending ahead of elections in October.
Analysts polled by Reuters had forecast a median increase of 2.5 percent in the monthly EMAE economic activity index, which is a close proxy for gross domestic product.
Economic activity increased 0.5 percent in June compared with the previous month, the government said.
Continuing signs that an economic recovery is taking root will be a boost to ruling party candidate Daniel Scioli, already the front-runner in the presidential race.
"As consumer confidence rises, so does the current administration's popularity and support for Scioli," political analyst Federico Thomsen wrote in a monthly report. "To avoid any hiccup in the economy before the elections, the government will continue its present policies."
Scioli's main rival Mauricio Macri, the business-friendly mayor of Buenos Aires, says Fernandez's high level of public spending is unsustainable and driving inflation higher. (Reporting by Buenos Aires newsroom; Writing by Richard Lough; Editing by Meredith Mazzilli and Bill Rigby)