Royal Bank of Scotland said Spain's Santander has pulled out of its 1.65-billion-pound ($2.65 billion) deal to buy 316 UK RBS branches in a blow to the state-backed British bank.

After the dramatic collapse late on Friday, RBS said it will restart the sale process, which had been ordered by European authorities as a cost for Britain's rescue of RBS back in 2008. It said significant work has been done to separate the business into a standalone form.

Santander UK agreed to buy the branches and the business of 1.8 million customers in August 2010, but completion of the deal had been put back several times as the two banks have struggled with technology and separation issues.

Santander's purchase price when the deal was struck represented a 350 million pound premium to net asset value of 1.3 billion at the end of 2009. The price of the deal could have been adjusted upon completion.

The deal had originally been due to complete in December 2011, and was seen as a key step for Santander to bulk up ahead of its planned flotation of its British business. Santander had been particularly keen to grab the 244,000 small and medium size business (SME) customers included in the deal.

RBS, 83-percent owned by the British taxpayer, was told to sell the branches as a price for taking billions of pounds in rescue funds from the government.

(Reporting by Steve Slater; Editing by Gerald E. McCormick & Theodore d'Afflisio)