The vehicles, built in Falkirk by Alexander Dennis, will operate on route 10 between Bonaly, Western Harbour and the city centre.
It follows First Glasgow announcing plans to increase the two electric buses it introduced last year to 22 from September and 148 by March 2023.
Lothian scrapped 15 diesel-electric hybrid buses three years ago over battery problems.
Its new vehicles, costing a total of £1.7 million, have been funded as part of a deal with SP Energy Networks’ green economy fund to help Edinburgh achieve net zero emissions by 2030.
Chief operating officer Guy Jefferson described the move as an “historic moment in Edinburgh’s journey to net zero” and said it would provide a “blueprint” for other bus routes.
The city council, which owns Lothian, will introduce the low emission zone next spring, in which only vehicles with the cleanest engines will be permitted.
Transport and environment convener Lesley Macinnes said: “This is a really exciting step forward for the city’s public transport network, and our own ambitions to achieve net zero carbon emissions by 2030.
“We want to make a green recovery from the pandemic and to do this we need to encourage more people to make sustainable transport choices.
"These buses offer a clean, reliable and environmentally-friendly alternative to the car.
“As we work towards the introduction of a low emission zone in Edinburgh too, electric and other low emission buses will be essential for transporting people to the city centre while maintaining clean, breathable air.”
Nigel Serafini, interim managing director of Lothian Buses, said: “Across the last decade, Lothian has removed around 15,000 tonnes of carbon dioxide from our carbon footprint through our fleet replacement strategies, and the introduction of Edinburgh’s first fully electric double decker buses allows us to continue on this journey, further reducing our impact on the environment.”
Transport minister Graeme Dey said: “As the country comes out of the pandemic and restrictions continue to ease, it is essential that our recovery is a green one, which has returning to public transport at its heart.”