(Reuters) - Britain's OneSavings Bank Plc warned of the rising cost of regulation and investment and a squeeze on margins, sending shares down 5 percent on Thursday.

The comments overshadowed a 21 percent rise in annual profit to 167.7 million pounds ($234.5 million) in 2017 for one of the banks aiming to challenge Britain's five dominant lenders.

OneSavings, which is heavily involved in property transactions, has focussed on bigger, professional landlords, while the broader market lost its sheen for amateur landlords due to tax and regulatory changes.

OneSavings said it expects to deliver net loan book growth in the mid-teens in terms of percentages in 2018, with net interest margin of about 3 percent, lower than the 316 basis points it reported in 2017.

CEO Andy Golding said the lender expected a cost to income ratio of about 30 percent for 2018, reflecting the significant increase in the cost of regulation and planned investment.

The lender expects to spend 7 million pounds on regulatory projects in 2018, around double the total in 2017.

"A lot of the costs that we are facing are industry wide. Things like the Global Data Protection Regulations, for a business with many hundreds of thousands of customers, that's an open heart surgery project," he told Reuters.

OneSavings said in 2016 that it had increased its focus on professional landlords and tightened lending criteria for financing smaller developments after the Britain voted to leave the European Union.

"I don't think the buy-to-let market will be the bandwagon that perhaps it was in 2014-2016," Golding said.

"Landlords who have a good professional portfolio or a multi- property portfolio, need a relationship with a good lender who can understand them and that's the game we want to play," he added.

Buy-to-let is a form of residential investment in which you buy a property, typically with a mortgage, with the view of renting it out.

OneSavings' market share of Britain's buy-to-let market rose to 6 percent in 2017 from 4 percent in 2016, highlighting the difficulties faced by British newcomers such as Virgin Money in challenging the established market grip of Barclays, HSBC, Lloyds Banking Group, Santander UK (>> Banco Santander) and Royal Bank of Scotland.

($1 = 0.7153 pounds)

(Reporting by Noor Zainab Hussain in Bengaluru; Editing by Gopakumar Warrier and Keith Weir)

By Noor Zainab Hussain