Ryan Nelsen has agreed to leave struggling QPR to take over as manager of Toronto FC in Major League Soccer.

The 35-year-old had been one of the west Londoners' few shining lights this season, having joined in June following spells at Blackburn and Tottenham.

Nelsen made 21 appearances in all competitions but has now agreed to leave Loftus Road to take up his first managerial role.

"This was too great an opportunity to turn down," Nelsen said at a news conference.

The defender must still negotiate his exit date though and will play for Rangers at the weekend.

"Nelsen is under contract with QPR until June 30th 2013, however, he has requested to enter dialogue with QPR boss Harry Redknapp to discuss when he will join up with his new club," read a statement.

"In the meantime, Nelsen will be available for the R’s Barclays Premier League fixture against Tottenham Hotspur this weekend."

It is unclear whether the job in Canada will also see him make a playing a return to MLS, having made his name there during a four-year spell with DC United.

The Washington club were another linked with a move for Nelsen, who was reportedly swayed to Toronto by their president and general manager Kevin Payne - an executive at DC United when he played there.

Nelsen's departure is a huge blow for QPR, who have won only two of their 21 Premier League games this season. Redknapp signed Nelsen when Spurs manager and has regularly highlighted his significant role at Loftus Road.