* Q2 net profit 1.28 bln euros, just above forecasts
* Hit by 368 mln euros of one-off charges
* Quarter on quarter profit in UK falls 14 percent
* Shares up 2.4 percent by 0822 GMT (Adds share reaction, analyst note, details)
By Angus Berwick and Jesús Aguado
MADRID, July 27 (Reuters) - Santander's profit was slightly above forecasts in the second quarter, despite falling 50 percent year-on-year, and the euro zone's biggest bank's shares rose on Wednesday on lower provisions for bad loans and an improvement in Brazil.
A 20 percent profit rise in Brazil over the first quarter pointed to a recovery in a country stuck in its worst recession in a century, offsetting a worse-than-expected performance by Santander in Britain after its vote to quit the European Union.
Overall, Santander reported net profit of 1.28 billion euros ($1.4 billion), just above analysts' forecasts. It was hit by net charges totalling 368 million euros from restructuring costs and a payment to the euro zone's resolution fund, which was set up to help wind down failed banks.
Santander shares had risen 2.4 percent by 0820 GMT and were close to the top of Spain's blue-chip Ibex index. The Spanish bank's shares have fallen around 17 percent over the last year against a 27 percent fall on Europe's STOXX 600 banking index.
In Britain, Santander's biggest market, the steep fall in the value of the pound after the Brexit vote caused net profit, when converted into euros, to fall 14 percent from the first quarter to the second. It was also hit by a new tax on banks.
Despite the uncertainty in Britain, whose share of Santander's business fell from 23 percent to 20 percent between the two quarters, the bank said its financial targets for 2016 were unchanged and it would maintain its dividend.
Brazil, which makes up 19 percent of the bank's business, was better than expected, analysts from Credit Suisse wrote in a note, while Britain's were 9 percent below consensus. They maintained their "neutral" rating for Santander shares.
Brazil's economy shrank for a fifth straight quarter in the first three months of 2016, but the drop was smaller than forecast.
Low interest rates and aggressive pricing continue to pressure Santander's margins in Spain, mirroring the experience of other Spanish banks, and its net profit there was down almost a third against the previous three months.
Analysts said a 12 percent decrease in the bank's provisions on bad loans in the second quarter year-on-year was better than forecast, while non performing loans fell in Spain and Britain.
Santander's progress in bringing its capital ratio more in line with its European peers slowed, however, over the quarter.
Its "fully-loaded" Common Equity Tier 1 ratio (CET1), a key measure of a bank's financial strength, rose just nine basis points to 10.36 percent after an increase of 22 basis points in the previous three months. But Santander said it was still on track to exceed 11 percent by 2018.
Santander's net interest income, a measure of earnings on loans minus deposit costs, was 7.6 billion euros for the second quarter, down close to 9 percent from a year ago.
For the first half of the year, net profit was 2.91 billion euros, falling 32 percent from the year before. ($1 = 0.9096 euros) (Editing by David Holmes and Alexander Smith)