The deal sees the 22-year-old – who has been given the number 32 shirt – move to Fratton Park for the remainder of the 2018/19 campaign.
Blues boss Kenny Jackett said: “He comes here with a point to prove and looking to play football on a regular basis.
“Ben’s a good all-round midfielder and has a little bit of everything – an impressive passing range, energy and is competitive.
“I’m looking forward to working with him and it is an area of the pitch where we do really need to improve.
“You never know what’s going to happen in the next two weeks and if we can improve the squad even further then that’s great.”
Thompson is a graduate of Millwall’s academy and has made 93 senior appearances for the Championship outfit.
He played the full 90 minutes for the Londoners in their Carabao Cup victory over Gillingham earlier in the week.
Following his first full campaign at the club, Thompson collected both the Young Player of the Season and Goal of the Season awards.