The Scotland international is a massive favourite with the QPR fans and scored 18 times for the club in 94 appearances during his first spell at Loftus Road between 2010 and 2013.
The 29-year-old scored some key goals during the first half of QPR’s Championship-winning season of 2010/11 before picking up an injury.
And, during QPR’s 2011/12 campaign in the top flight, he scored a dramatic late winner against Liverpool at Loftus Road and netted to make it 2-1 at Manchester City in a memorable final day of the season encounter, only for the hosts to score twice in stoppage time and claim the title.
QPR have been relegated twice from the top flight since that day and are back in the Championship once again for the 2015/16 season.
Mackie told the QPR website: “I’m absolutely buzzing to be back.
“Anyone that knows me will tell you just how much this club means to me, and the feelings that I’ve got for the place have only grown in the short time I’ve been away.
“People say never go back, but I feel as though I’ve got some unfinished business here and, under the guidance of Les (Ferdinand) and Chris (Ramsey), I can only see a bright future for this club.
“They know I’ll come in and give my absolute maximum and – having in played in front of the QPR fans before – I know that’s exactly what they love to see. It’s great to be back.”
QPR head coach Chris Ramsey added: “I’ve always admired Jamie. His qualities as a player, combined with his energy and commitment, are just what we’re looking for.
“His desire to come back here and be a success again, second time around, says everything you need to know about him.
“I’m hoping now he’s a little bit older and wiser, that he’ll bring some experience and maturity to the dressing room.
“I’m sure the fans will welcome him back with open arms, it’s a really good addition for us.”
And Director of Football Les Ferdinand said: “It’s not for me to comment on why Jamie left when he did, but what I do know is how much QPR means to him. It’s important we have people like him, with the right attitude, who want to help us progress.
“We want a front-line that can rotate, that can be progressive, and Jamie ticks those boxes. He can come and get it, go in behind, run the channels. He’s got great versatility.
“We’re delighted to have him here. There’s no doubt he’ll play an important role in helping to take us where we want to be.”
Tune into Sky Sports News HQ from 9am on Tuesday when the fixtures for the new Sky Bet Championship season will be announced.