Hit BBC1 school drama Waterloo Road is moving to Scotland after six years set in a Lancashire town.
The relocation will be played out in a "dramatic and explosive storyline" at the end of the seventh series, in which some of the current teachers and pupils at the troubled Rochdale comprehensive set up an independent school in Scotland.
It is not yet known which stars of the award-winning series will be written into the move.
Controller of BBC drama commissioning Ben Stephenson said Waterloo Road "will remain the show our audience love".
"Alongside River City, the arrival of Waterloo Road establishes Scotland as a home of mass drama production," he said.
The drama will move to an "as yet unidentified location in Scotland" from April next year to film an initial 50 one-hour episodes over two years.
Eileen Gallagher, chief executive officer of Shed, the Glasgow-based production company which makes Waterloo Road, said: "The inspiration for Waterloo Road came from its creator, Ann McManus, who spent several years teaching in Glasgow secondary schools. It now seems fitting that Waterloo Road has come full circle to be made in Scotland.
"But the essence of the show will remain the same - a drama about the highly topical issue of how families and schools help children reach adulthood."
Waterloo Road, which attracts more than five million viewers, triumphed at this year's National Television Awards to beat Sherlock and Doctor Who to most popular drama.
The BBC wants to increase network programming from Scotland.