The Green Investment Bank (GIB), set up by the UK government five years ago, has been sold to Macquarie Bank, with a value of £2.3bn.
The Treasury secures £1.7bn through the process, with a further £600m of liabilities taken on by the Australia-based business lender.
The bank was set up to fund renewable and low-carbon projects and has invested about £800m per year so far.
That includes total government funding of £1.5bn since 2012.
The deal with Macquarie should see that rise to £3bn per year over three years.
It requires the new owner to retain its name and headquarters team in Edinburgh.
A new asset management division is being set up in the Scottish capital. The bank currently employees 50 people in Edinburgh and 85 in London.
Although all the shares are transferring, the government is appointing independent trustees with the power to ensure it continues to have an environmental mission.
UK Climate Change and Industry Minister Nick Hurd, who signed the deal on Wednesday, said the government had turned a profit on the deal.
He said the Green Investment Bank had been "very successful in attracting private capital to the UK's green economy".
"It now makes sense to move it into the private sector where it will be free from the constraints of public sector ownership, allowing it to build further on its success," he said.
"This deal gives us the best of both worlds. We have secured fair value for the UK taxpayer.
"GIB has a well-funded new owner that is committed to the bank's green mission, with a track record of success in green investment and an ambition to grow the business."
Macquarie Group chief executive David Fass said the deal would open new opportunities in low-carbon investment in the UK and further afield.
"We are excited by a business that will take a leading role in the green economy, using the specialist knowledge of our teams in Edinburgh and London," he said.
Lord Smith of Kelvin, chairman of the GIB, said the sale decision had been supported by the board as it believed that attracting new investors was the "best available route" to securing the long-term future of the business.
"Macquarie has made significant and important commitments to the UK government to maintain GIB as a discrete entity within its business, maintaining GIB's investment focus and approach with a target to invest more capital each year than GIB has historically."
Lord Smith added: "Macquarie will also uphold GIB's green investment principles and report transparently on GIB's green impact.
"Macquarie will utilise the market-leading expertise of the existing GIB team and will build on GIB's deep commitment to Edinburgh."
The Scottish government did not favour the sale, but has welcomed the commitments made by the new owners of GIB.
Scottish Economy Secretary Keith Brown said: "This announcement is testament to the talent and opportunity to be found here, and I look forward to working with the Macquarie Group to ensure its ambitious plans for Scotland are realised."
Environment pressure group Greenpeace has criticised the bank's sale and Macquarie's past role in infrastructure funding.
The organisation's policy director, Doug Parr, said: "At a time when the government should be shoring up the low-carbon industry for post-Brexit Britain, they have given away one of our key tools for advancing green technologies.
"The hole left by the Green Investment Bank will slow our transition to a clean energy system, set us back on reaching our climate targets, and mean more of the jobs from new sectors will go elsewhere."
The sale was a competitive bidding process, begun under then UK Business Secretary Sajid Javed.
It was delayed by the complexity of the deal, particularly after GIB signed an £800m funding deal for offshore wind at the start of this year.
There was also a legal challenge lodged by a consortium that lost out to Macquarie.
Included in the arrangements for the sale is the setting up of a new joint venture for financing offshore wind projects, along with another Macquarie infrastructure fund, and USS, the university staff pension fund.