(Adds second-quarter expansion, sector growth and context)
By Teresa Cespedes
LIMA, Aug 14 (Reuters) - Peru's economy grew by a faster-than-expected 3.87 percent in June from a year earlier, a strong uptick from May and one of the fastest monthly expansions of the past year, state statistics agency Inei said on Friday.
A Reuters poll had forecast 3 percent year-on-year expansion in June. The central bank had said the reading would probably come in above 3 percent.
The official figure could bolster business and consumer confidence, a lift the government says is needed to consolidate a fragile recovery.
Peru's mining-fueled economy has slowed sharply in the past 1-1/2 years as weak mineral prices have curbed investment.
The economy expanded by 3 percent in the second quarter of 2015 from the year-earlier period, and by 2.42 percent in the first half, Inei said.
The annual growth rate rose to 1.92 percent in June.
Mining led growth in June with a 14.15 percent expansion as output from new copper mines and small-scale gold miners rose.
Retail and wholesale sales were up 4.1 percent and agriculture 8.1 percent.
But construction fell 3.15 percent; fishing, 29.6 percent; and manufacturing, 2.89 percent, official data showed.
The economy grew by a seasonally adjusted 1.1 percent rate in June from May, when it expanded by just 1.22 percent year-on-year, Inei said.
In 2014 the economy expanded by 2.35 percent, half as fast as in recent years when growth topped 5 percent.
The government and central bank have said the economy should rebound in the second half of the year on public spending, and should end the year with growth of close to 4 percent.
Many private analysts have said that figure is too optimistic. (Reporting By Teresa Cespedes, Writing by Mitra Taj; Editing by Bill Rigby, Lisa Von Ahn and Peter Galloway)