The troubled entertainment chain HMV is expected to confirm this morning that it has secured a new deal with its banks, pushing its shares up by 50%.

The company has been in talks with its lenders, Royal Bank of Scotland and Lloyds Banking Group, for months and last night was finalising the terms of the arrangement, which could see them handed up to 5% of the company.

Poor sales saw HMV's debt balloon to an unsustainable £170m in the year to 30 April – a situation that forced its chief executive, Simon Fox, to sell HMV's sister chain Waterstone's to Alexander Mamut, a Russian billionaire, for £53m. More details of the arrangement will be revealed in the circular setting out the terms of the sale.

The restructuring gives HMV, which is also shutting 60 shops, two years to get sales back on track. It floundered as music sales shifted to the internet as well as from stiff competition from supermarkets. Fox is trying to reinvent the business as a multi-media group that hosts concerts as well as festivals. It has also teamed up with Curzon to open cinemas.

Since the beginning of 2009 the shares have dropped from 130p to below 10p. Yesterday they put in a strong rally to close up 4.05p at 12.25p.