LONDON -- Royal Bank of Scotland (NYSE: RBS) unveiled its first-quarter results this morning and saw its shares shoot to the top of the FTSE 100 (INDEX: ^FTSE) leaderboard.

RBS = Ruined Bank Stabilized
As I write, RBS shares trade up 2.6% at 25.2 pence, valuing the bailed-out bank at 15 billion pounds. This market reaction came despite news that RBS lost another 1.4 billion pounds in the first three months of this year. However, this loss is almost entirely due to an accounting writedown on the bank's own debt.

In the first quarter of 2012, total income at RBS was close to 6.9 billion pounds, down almost 11% on Q1 2011. As a result, core operating profit dropped to nearly 1.7 billion pounds, diving 25%. After nearly half a billion pounds in losses at noncore businesses, the bank's operating profit came in just shy of 1.2 billion pounds, 4.5% ahead of a year earlier.

However, RBS ended up with a statutory loss before tax, largely due to an adjustment of almost 2.5 billion pounds in the value of its own debt. As RBS's creditworthiness has improved in 2012, the value of its own bonds has risen. Therefore, this increased liability caused one huge accounting adjustment.

RBS also paid 43 million pounds to the government for the financial protection provided by the Asset Protection Scheme safety net. In addition, the group set aside another 125 million pounds to meet increased payment protection insurance compensation.

The net result of all this accounting malarkey is that RBS recorded a loss before tax of more than 1.4 billion pounds in three months.

Boring banking
Given that British taxpayers bought our stake in RBS for 45.2 billion pounds at an average price of 49.9 pence per share, we are sitting on a massive loss. As things stand, we've lost about half of our bailout money.

Despite this recent loss, RBS is looking healthier by the day. When (no longer Sir) Fred Goodwin and his merry band of directors were at the helm, RBS's balance sheet swelled to 2.4 trillion pounds. Alas, it was packed with dodgy assets like subprime mortgage securities, which promptly bombed.

Almost five years on, RBS is a much smaller and more stable bank. Its funded balance sheet (total assets minus derivatives) has dropped to 950 billion pounds, down almost 10% in a year. Assets at its noncore businesses fell another 11 billion pounds to 83 billion pounds as it sold off unwanted items.

As for bad debts and other impairments, these exceeded 1.3 billion pounds but were still down 33% year on year, helped by lower write-offs in U.K. retail banking. What's more, the bank's loan/deposit ratio has dropped from 116% to 106% in a year, so RBS has increasingly more cash deposits backing its loan book.

However, one key indicator went in the wrong direction: The "Core Tier 1" ratio -- a measure of capital strength -- dipped to 10.8% from 11.2% a year earlier.

RBS = Really Buy Shares?
Another of the FTSE 100 firm's fundamentals weakened: Tangible asset value per share slid to 48.8 pence from 50.1 pence. Even so, this means that RBS shares trade at just more than half (52%) of their underlying asset value.

Stephen Hester, RBS chief executive, said today:

We are happy with progress in the first quarter, though the economic and regulatory backdrop remains tough. RBS continues, markedly, to regain strength and resilience. Our focus is on improving the future for customers and our business, whilst ensuring that the bank's past issues are dealt with.

Clearly, Hester still has plenty of legacy issues to tackle, but RBS is gaining strength and reducing risk. Then again, are its shares now in value territory? I suspect so.

RBS is poised to repay its last tranche of funding from the Bank of England's liquidity support schemes. Also, it is resuming dividend payments and coupons on hybrid securities. These two steps suggest that Hester is confident RBS is well on the road to recovery.

At 25.2 pence, RBS shares trade on a forward price-to-earnings ratio of 10.5 and offer a prospective dividend yield of 0.2%, covered almost 47 times. Although these are not compelling fundamentals, we have to bear in mind that this is very much a business in transition.

While I believe more turmoil lies ahead for financial markets, RBS offers the potential for decent medium-term gains. Hence, a tentative buy now could yield market-beating returns in the years ahead. This is one share to tuck away and wait for "boring banking" profits to return!

Warren Buffett buys British! The legendary investor has recently topped up on his favorite U.K. blue chip. Discover what he bought -- and the price he paid -- within our latest free report!

Further investment opportunities: