Olsson, who played 261 times after joining the Baggies in 2008, would have been out of contract this summer.
But the Premier League club have agreed to cancel his deal early so he can return to his homeland in time for the start of their new top-flight season.
"Albion has, and will always be, a huge part of my life," said Olsson, 34.
"It's all happened so quickly I've not had chance to say a proper farewell to so many people. I will be back at the first chance to do that.
"I'm really grateful to the club for helping me sort out this transfer," said the Swede, who also captained Albion during his near nine years' service to the club.
Meanwhile, teenager Kane Wilson has signed his first professional contract at The Hawthorns, the 17-year-old defender having signed a deal which ties him to Albion until the summer of 2019.
Find all the latest football transfers on our dedicated page.
West Bromwich Albion's long-serving defender Jonas Olsson has had his contract cancelled to allow him to move back to Sweden to join Djurgarden IF.