U2 will take a break from their North American tour to play Glastonbury
U2 are to headline next year's Glastonbury Festival, helping the event celebrate its 40th anniversary with their first appearance there.
The band will lead the line-up at the Somerset show on Friday 25 June.
It will be their first festival gig for more than 25 years and will see them make a flying visit to the UK in the middle of a North American tour.
Some 177,500 people will be at the event, but tickets sold out in 24 hours after going on sale last month.
A statement from festival organiser Michael Eavis said: "The 26-year-old rumour has finally come true. At last, the biggest band in the world are going to play the best festival in the world.
"Nothing could be better for our 40th anniversary party. And there are even more surprises in the pipeline..."
U2 will play a stadium show in Edmonton, Canada, on 23 June as part of their 360 Degrees world tour.
U2 will be among the main attractions on the festival's main Pyramid Stage
They have been performing on a custom-built giant "claw" stage, but will swap that for Glastonbury's main Pyramid Stage on the festival's first night.
They will then travel to the US to resume their tour in Minneapolis, Minnesota, the following evening.
U2 promoter John Giddings said on Twitter: "It is true, U2 headline the Fri night @ Glastonbury. They fly back for the weekend in the middle of their US tour."
The band have not performed at festivals since their early days, since preferring to play their own stadium gigs complete with elaborate sets and stage shows.
Bassist Adam Clayton is the only band member to have played at Glastonbury before, having joined the Hothouse Flowers on stage for one song in 1989.
Since starting in 1970, Glastonbury has grown into the UK's largest music festival, and is one of the best-loved events in the summer calendar.
Speaking in September about the anniversary, Mr Eavis told the BBC: "The expectations are really high. So we have to deliver on that. We're trying to get the best headliners in the world."
Bruce Springsteen, Blur and Neil Young headlined this year's show, which was named best major festival at last week's UK Festival Awards.
Next year's event takes place on Mr Eavis' dairy farm from 25-27 June. No other artists have yet been confirmed, although US crooner Andy Williams announced that he will be performing.