Jansson made 120 appearances for Leeds United before joining Brentford for an undisclosed fee in the summer of 2019.
The centre-back has featured in 115 games for the Bees, chipping in with four goals and two assists.
Jansson was a key part of the Brentford side that won promotion to the Premier League in the 2020-21 campaign, helping the West London club end their 74-year absence from the top flight.
After spending four years with the Bees, Jansson will leave the club when his contract expires at the end of the season and return to Malmo for a second spell.
"It is tough to put these last four years into words," Jansson told the club website. I am so thankful for my time here and the journey that the club and I have been on.
"When I joined, we were a middle of the Championship club and now I'm leaving a club that's hopefully about to finish top 10 in the Premier League.
"I've been on a massive personal journey as well. I matured into a captain, and a leader, because of this club."
Jansson has played his last game for Brentford after he sustained a hamstring injury in last Saturday's defeat to Newcastle United, which will keep him out for the rest of the season.
Commenting on Jansson's departure, Brentford head coach Thomas Frank said: "It's been a pleasure to work with Pontus over the last four years.
"He came in and was a big part of the reason why we could, straight away, compete for Premier League promotion; he helped us become one of the best defences in the Championship that year.
Frank went on to add: "No matter who you are coaching you always create relationships with the players, some stronger than others, and Pontus is one of the players I created a strong bond with.
"He's given so much to the club and the team. I wish him and his family all the best for the future."
Brentford will be in Premier League action on Saturday afternoon when they travel to Molineux to face Wolverhampton Wanderers.