The New York Rangers say they have agreed to terms with Dan Girardi on a multiyear contract extension, taking the key defenseman off the trading block and keeping him away from unrestricted free agency.

The deal announced Friday came after lengthy negotiations that were finished just days before the NHL trade deadline on Wednesday.

If a new contract couldn't be worked out by then, the possibility existed that Girardi would be dealt before he would have a chance to leave without the Rangers getting anything in return.

New York is still trying to work out a new deal with captain Ryan Callahan, who can become an unrestricted free agent this summer. The gritty forward has been holding out for a longer deal than the Rangers have so far been unwilling to agree to. The U.S. Olympian could be sent packing in less than a week.