The Scottish capital beat off competition from 18 other cities helped by the proliferation of renewable energy schemes across the country.
But a fudged decision to split its functions means the main transactions team will be based in London.
The bid assessment team actually ranked London top on points with Edinburgh coming in second, but other considerations saw the Scottish capital win the main prize.
The decision is a blow to Birmingham, London, Manchester, Milton Keynes, Peterborough and Birmingham which all made the final shortlist.
The new bank, whose exact location is yet to be revealed, starts out with a £3bn public cash pot to help firms finance early-stage renewable energy projects
Business Secretary Vince Cable said: “Harnessing the strengths of Edinburgh and London will support the Green Investment Bank’s ambition to become a world leader.
“Edinburgh has a thriving green sector and respected expertise in areas such as asset management.
“London, as the world’s leading financial centre, will ensure that the GIB’s transaction team can hit the ground running.
“This decision will allow the GIB to operate effectively and achieve its mission of mobilising the additional investment needed to accelerate the UK’s transition to a green economy.”
The next step for the GIB is the recruitment of the chair and senior independent director so that it will be in a position to be fully operational this Autumn, subject to state aid approval for the GIB.
The GIB is expected to employ 50-70 full time equivalent staff across the two sites.