But it will have to pay the UK government £2.5bn to avoid joining the Government Asset Protection Scheme (Gaps), which provides state insurance for past toxic loans.
The payment is to cover the "implicit protection" provided by the government since it first offered to insure Lloyds' book in February.
RBS, meanwhile, has confirmed it will join the scheme on revised - and more expensive - terms, the Treasury said.
Both banks have also agreed not to pay any cash bonuses to staff earning more than £39,000, for their performance in 2009, while board members will defer all their bonus payments for this year until 2012.
But compensation could come in the form of shares in subsequent years.
"I believe what we have here is a better deal for the taxpayer," Chancellor Alistair Darling told the BBC.
"It is better in the long run to get private money because at the end of the day, the government does not want to be in the business of running banks," he added.
The BBC's business editor Robert Peston suggested the Treasury had now become, in effect, the biggest hedge fund in the UK.
George Osborne, the shadow chancellor, responded to the announcement by saying: "Let's not miss the elephant in the room."
"The government is having to put another £39.2bn of taxpayer's money into the banks - a bigger bail-out than the original bail-out last autumn. Yet still there is no guarantee that it will get credit flowing in the economy."
In addition to the sales of RBS branches in England and Wales - originally Williams & Glyn's - RBS will sell its NatWest brand in Scotland, RBS Insurance and Global Merchant Services, its card payment business.
The total disposal will be 318 branches in the UK, or 14% of the RBS retail network.
Brown welcomes banks plan
"I believe today marks a key milestone in the radical restructuring we are undertaking to bring RBS back to stand-alone strength," RBS chief executive Stephen Hester said.
RBS said the moves would cut its UK market share by two percentage points in retail banking.
It will also sell its stake in commodities trader RBS Sempra Commodities.
Lloyds will sell at least 600 branches, or about 4.6% of the total market of UK current accounts.
That includes Lloyds TSB in Scotland along with some branches in England and Wales and mortgage broker Cheltenham & Gloucester, as well as the Intelligent Finance online business.
Lloyds says the businesses that it will have to sell off account for about £30bn of customer deposits and £70bn of lending, generating income of £1.4bn in the year to December 2008.
Mr Peston said the "forced fragmentation" of UK banks was a priority of outgoing European Competition Commissioner Neelie Kroes.
But Mr Darling insisted the government wanted the break-up to happen.
"We were very clear with the Commission that we didn't want to see the banks move pieces around a board," he said.
"I would like to see, perhaps three new entrants to the High Street."
Names like German insurance giant Allianz, Generali and Zurich are being mentioned as potential acquirers for the branches sold by RBS and Lloyds, said Douglas Fraser, BBC Scotland's business editor.
Unlike Lloyds, RBS will join Gaps and have £282bn of its assets insured by the taxpayer.
That is less than £325bn of toxic assets first proposed in February, according to the Treasury.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.