Royal Bank of Scotland (RBS) shares were up in the first minutes of trading after the U.K. lender reported it had swung into profit in the third quarter and expects to return to full-year profit in 2018.

RBS shares were up 2.17%, extending a three month gain of 14%, to change hands at 287.12 pence.

The majority state-owned bank reported an attributable profit of £392 million in the three months to the end of September, compared with a £469 million reported in the same time period last year and beating analyst forecast of £310 million. This brings the bank's total attributable profit for the year to £1.33 billion.

RBS, with is 71% owned by the U.K. government after a bailout during the financial crisis, said the results were buoyed by lower costs. The bank has cut £708 million in costs since the beginning of 2017.

The bank said that it was on track to deliver its 2017 financial targets. RBS's stated ambition for the year is to grow income, cut costs and use less capital across its core businesses and to make progress on resolving legacy issues. Adjusted income has increased by 5.6% in in the third quarter compared with the same quarter in 2016 and has increased by 7.5% for the year to date.

The bank has been distracted attempting to resolve legacy issues. It still has an impending settlement with the Department of Justice over misselling of mortgage-backed securities. The bank gave no update of the DoJ settlement but indicated that further provisions may be taken in 2017.

"We retain the 2017 full year financial guidance and medium term financial outlook we provided in the 2016 Annual Results document. In addition, and subject to any further provisions for the investigations of the US Department of Justice into the Group's historic RMBS related activities being substantially taken in 2017, our expectation remains that we will be profitable in 2018," the bank said.

More of What's Trending on TheStreet:

More from Investing

We Asked Our Pros About the Longevity of the Bull Market

We Asked Our Pros About the Longevity of the Bull Market

Citigroup Has Finally Broken Out of a Six-Month Base Pattern

Citigroup Has Finally Broken Out of a Six-Month Base Pattern

Closing Bell: LIVE MARKETS

Closing Bell: LIVE MARKETS

Legendary Technician Gives Her View of the Current Market

Legendary Technician Gives Her View of the Current Market

Jim Cramer: PulteGroup Is the Stock to Watch Next Week

Jim Cramer: PulteGroup Is the Stock to Watch Next Week