GREENBURGH, N.Y. -- Veteran forward Rasheed Wallace has retired from pro basketball for the second time, the New York Knicks announced Wednesday.

Wallace played in 21 games this season with the Knicks but missed most of the season with a stress fracture in his left foot.

Wallace returned to the floor Monday against the Charlotte Bobcats for the first time since Dec. 13 but played just four minutes because of foot soreness. The Knicks had hoped to have Wallace, 38, back for the playoffs.

"Rasheed has given this team everything he had," Knicks coach Mike Woodson said in a statement provided by the team. "He is a winner, true professional and leader on and off the court. Due to his injury, he will not be available to play for us during the playoffs."

Woodson later added that he was "a little shocked" to learn of Wallace's decision.

"There comes a time when you know you just can't answer the ball anymore. That's the hard part about playing professional sports because it's tough to walk away when you know you can't do it anymore," Woodson said.

Woodson convinced Wallace, whom he coached in Detroit, to end a two-year retirement and sign with the Knicks during training camp.

Wallace was an integral part of the Knicks' 17-5 start. He averaged 7.2 points and 4.4 rebounds in 14 minutes before he was sidelined by the foot injury. Woodson believes Wallace will remain with the team in some capacity.

"It's going to be a loss not having him (on the floor). But it was his decision. We have to respect that," Woodson said.

A first-round draft pick in 1995, Wallace played 15 seasons in the NBA and won a title with the Detroit Pistons in 2004. He retired in 2010 after one season with the Celtics in which the team lost to the Lakers in the Finals. Wallace came out of retirement to sign with the Knicks in October.

He finishes his career with averages of 14.4 points and 6.7 rebounds per game. The four-time All-Star has been known as a volatile player and finishes as the all-time leader in technical fouls with 304.

Wallace's retirement opened up a roster spot for the Knicks, who announced Wednesday afternoon they had signed center Earl Barron.

The 7-foot Barron averaged 3.7 points in 17 games for the Washington Wizards this season before being waived in late December. The six-year veteran played in seven games for the Knicks at the end of the 2009-10 season.

Ian Begley is a regular contributor to ESPNNewYork.com.