Barclays has set aside an extra £300m for settling claims of mis-selling payment protection insurance, but says it made an "encouraging" start to 2012.
A £2.62bn accounting adjustment and the extra PPI provision meant the bank reported a statutory pre-tax loss of £475m in the first quarter, compared with a £1.66bn profit a year ago.
But stripping out the impact of these, it made a profit of £2.45bn, which was ahead of analysts' forecasts of £2bn.
It allowed £1bn in 2011 for PPI claims.
Barclays holds its annual general meeting on Friday, where shareholders will vote on a pay deal for chief executive Bob Diamond and other senior executives.
Between a quarter and a third of investors are expected to vote against the deal.
The bank said that profit had been driven by "strong performances in both retail and business banking and corporate and investment banking, with the non-investment bank businesses showing significant growth in adjusted profits".
Profit at its UK retail banking arm rose 16% to £334m, while profits at Barclaycard rose 18% to £349m.
The £2.62bn debt valuation adjustment refers to a loss Barclays would make if it had to buy back its own debt now. It is an accounting technique and not a physical loss.
The increase in PPI provisions came after banks saw a steep rise in claims last year following the loss of a legal challenge over PPI rules in April.
PPI is supposed to cover borrowers' loan repayments if they fall ill, die, or lose their jobs. But it became highly controversial and there were years of campaigning by consumer groups against the widespread mis-selling of the policies.
"Barclays first-quarter results are an encouraging start to the year and demonstrate continued progress across our execution priorities," said Mr Diamond.
"The environment in which we operate remains unpredictable but we have proven ability to adapt and grow our businesses in the face of external change.
"We will be proactive and seek to lead the agenda on recovery and resolution planning, which is a critical step to eradicate 'too big to fail', while continuing to remain closely engaged with regulatory agencies and governments."
Richard Hunter, head of equities at Hargreaves Lansdown Stockbrokers, said: "At a time of continuing scrutiny for all aspects of the banking sector as a whole, Barclays has come out fighting in 2012."