Ferguson’s seven-year association with Newcastle United came to an end this week after the League One club had an undisclosed fee accepted.
The versatile 24-year-old – who can play on the wing and at full-back – had been on loan at The Den.
“It’s a relief to get the deal done,” said the Northern Ireland international.
“I’ve been keen to get everything sorted, and I’m now really looking forward to my future with Millwall.
‘Bully’ broke disabled girlfriend’s arm and dragged her through broken glass in shocking campaign of cruelty
The 16 places where most crime was reported across South Tyneside in June
13 great pictures as the sunshine sees crowds flock to South Shields beaches
South Tyneside man given jail warning after breaching court order
‘Sinister’ paedophile watched children play and offered them doughnuts after moving into new neighbourhood
“I’ve loved every second of my time here, so it was a no-brainer to sign on a permanent basis.
“My task now is to help Millwall get back where we belong, which hopefully can be done this season.”
Millwall managaer Neil Harris said: “Shane has displayed his ability in two different positions for us since he joined on loan, so naturally I’m delighted that he is now with us on a permanent basis.”