Redknapp took over at Loftus Road in November 2012 and helped the club back into the Premier League but leaves the club second bottom of the top flight.
The 67-year-old will undergo knee replacement surgery in the coming weeks with Les Ferdinand and Chris Ramsey placed in temporary charge of the team until further notice.
Redknapp said in a QPR statement: "I have had such a fantastic time at QPR. I would like to thank the board, the players and all my staff, and especially the supporters who have been absolutely fantastic to me since I arrived at the club for their tremendous support.
"Sadly I need immediate surgery on my knee which is going to stop me from doing my job in the coming weeks. It means I won't be able to be out on the training pitch every day, and if I can't give 100 per-cent I feel it’s better for someone else to take over the reins.
"My relationship with [chairman] Tony Fernandes has been one of the highlights of my footballing career and I wish the club every success. I am confident they will survive in the Premier League this year.”"
Chairman Fernandes added: "I would like to take this opportunity to thank Harry for everything he has done for QPR during his time in charge.
"We part on good terms and I would personally like to wish him all the best for the future."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.