The 18-year-old American artist wrote the song for No Time To Die with her elder brother, Finneas O'Connell.
Eilish said: "It feels crazy to be a part of this in every way.
"To be able to score the theme song to a film that is part of such a legendary series is a huge honour.
"James Bond is the coolest film franchise ever to exist. I'm still in shock.
"Writing the theme song for a Bond film is something we've been dreaming about doing our entire lives.
"There is no more iconic pairing of music and cinema than the likes of Goldfinger and Live And Let Die. We feel so so lucky to play a small role in such a legendary franchise, long live 007."
Hours before the announcement, the Los Angeles-born star posted eight pictures of Bond girls, from Halle Berry to Lea Seydoux, on her Instagram stories, prompting speculation she would be performing the track for No Time To Die.
Eilish had already been linked to the 25th Bond film after director Cary Fukunaga recently followed her and her brother on Instagram - one of only 80 people he follows.
Other artists who had been linked to the No Time To Die theme include Dua Lipa and Beyonce.
Eilish is the youngest recording artist to perform the title track, and if previous performers are anything to go by, she could win awards for it.
Bond producers Michael G Wilson and Barbara Broccoli said: "We are excited to announce that Billie and Finneas have written an incredibly powerful and moving song for No Time To Die, which has been impeccably crafted to work within the emotional story of the film."
Fukunaga added: "There are a chosen few who record a Bond theme. I am a huge fan of Billie and Finneas.
"Their creative integrity and talent are second to none and I cannot wait for audiences to hear what they've brought - a fresh new perspective whose vocals will echo for generations to come."
Sam Smith was 23 when he sang Writing's on the Wall, the theme for the last James Bond instalment, Spectre, which he won a Golden Globe and an Oscar for.
Adele was 24 when she sang Skyfall for the film of the same name and won several awards including an Oscar, a Brit Award, a Grammy and a Golden Globe.
Eilish's debut album When We All Fall Asleep, Where Do We Go? topped the UK and US charts when it was released last year.
It was the highest performing album in the US last year and the teenager already has two American Music Awards, two Guinness World Records and three MTV Video Music Awards.
She is also nominated for six Grammy Awards, including album and song of the year.
Her brother wrote, produced and recorded the album with his sister in their childhood home in Highland Park, Los Angeles. He is nominated for five Grammy awards, including producer of the year, non classical.
Hans Zimmer was confirmed on Monday as the new composer for No Time To Die's score - less than three months before the film's release on 2 April.
The Oscar-winner, who composed Gladiator, three Batman films and The Lion King, replaces Dan Romer who left the project in December, citing creative differences.
No Time To Die is no stranger to big names walking out, with British director Danny Boyle originally taking the helm before walking out in August 2018.
He was replaced by American Fukunaga the following month.