Nilsson, 27, recently played for Kalmar in his native Sweden and has trained on his own since his release in November.
"I am a big player, I like to use my body, play tough and win headers. I like to run, I'm quite fast," he said.
The club have also released former Blackpool and Huddersfield midfielder Keith Southern, who later announced his retirement at the age of 34.
After beginning his career as a youth with Everton, Southern turned out over 300 times in a 10-year spell with Blackpool and returned to the area with Fleetwood in 2014 after two years at Huddersfield.
Fleetwood Town have signed free-agent defender Marcus Nilsson on a deal to the end of the season.