Paul Hart told the club's official website: "We're just delighted to bring in someone of Marlon's calibre who genuinely wants to play for Nottingham Forest.
"He's a goal-scorer and a goal-maker and I'm sure he will fit in with our style of play. The good thing is that he wants to learn and was clear in his mind about joining us."
King has managed five goals in 13 games for the Gills this season and he will be looking for a debut goal against West Brom on Saturday.
King said: "I can't wait to get started. I had my mind set on joining Forest and I'm delighted that everything has been sorted out this week."
He will take over Marlon Harewood's squad number of 11 following his £500,000 move to West Ham earlier this week.