Mayflies begins in a small Scottish town in the summer of 1986, when best friends Tully (Curran) and Jimmy (Compston) ignite a brilliant friendship based on music and films that takes them on a weekend pilgrimage to Manchester.
Inspired by the music and culture they love, they vow to take a different path through life to their fathers - but 30 years on, Tully calls Jimmy with the worst kind of news, and a request that will test their friendship, love, and loyalty to the limit.
O'Hagan's novel was first published in 2020 and the adaptation is set to be filmed around Glasgow and Ayrshire this autumn.
Gaynor Holmes, BBC drama commissioning editor, said: “We’re incredibly proud to continue the BBC’s longstanding commitment to showcasing the very best of Scotland and Scottish talent with this distinctive new drama.
"Mayflies is an intimate and devastating portrait of male friendship that manages to be both life-affirming and heartbreaking, and we’re delighted to have assembled an outstanding lead cast and creative team to bring it from page to screen.”
Compston, who also appeared in BBC drama Vigil, has recently hinted that the police procedural he is best known for, Line Of Duty, could be on its way back to BBC One for a seventh series.
He posted a photo on Instagram of himself with co-stars Vicky McClure and Adrian Dunbar, and series creator Jed Mercurio, enjoying a drink together captioned: "Talking tattoo designs."
They had previously said they had agreed to get matching tattoos if the series reached 12 million viewers, sending fans into a frenzy of excitement that a new series could be on the way.
Watch: Martin Compston ran marathon to pub to watch Rangers v Celtic