Lewis said, "It is time for me to create a new legacy" after 17 NFL seasons.
He intends to play for the first time since tearing his triceps two months ago when the Ravens host the Colts in Sunday's wild-card game, saying: "There is no reason for me to not play," according to The Baltimore Sun.
Sunday likely will be Lewis' final game in Baltimore even if the Ravens win because of their No. 4 seed entering the playoffs.
"I talked to my team today," Lewis said Wednesday. "I talked to them about life in general. And everything that starts has an end. For me, today, I told my team that this will be my last ride."
He returned to practice on Dec. 5, and for him to be eligible for the playoffs, the Ravens added him to the active roster later in the month.
Colts coach Chuck Pagano, Lewis' defensive coordinator last year, said, "I thought, shoot, the guy could play forever and would play forever. Great person, great man, great player, just an unbelievable human being -- what he's done for that organization, that city and for that matter, so many people. He's obviously a first-ballot Hall of Famer and will be sorely missed."
Lewis has gone to 12 Pro Bowls, been named first-team All-Pro seven times and been voted NFL Defensive Player of the Year twice. He led the Ravens in tackles in 14 of his 17 seasons, the exceptions being those years in which he missed significant time with injuries (2002, 2005, 2012).
"I never played the game for individual stats. I only played the game to make my team a better team," he said.
Baltimore linebacker Terrell Suggs, who is almost always upbeat, said of the announcement: "It was sad. It affected me, because for the past 10 years of my career, I've been sitting right next to the man and going to war on Sundays. It's going to one hard last ride, and we need to make it one to remember."
Lewis led the Ravens to the 2000 Super Bowl title when he was the key figure on a defense that set the NFL record for fewest points allowed in a 16-game season.
Lewis had hinted at retirement previously. He said last summer that he couldn't see himself playing past age 37. Lewis turned 37 in May.
Lewis wants to spend more time with his two sons. While working to return from his injury, Lewis watched them play on the same high school football team, and he intends to watch Ray Lewis III perform as a freshman next year for his alma mater, the University of Miami.
"God is calling," Lewis said. "My children have made the ultimate sacrifice for their father for 17 years. I don't want to see them do that no more. I've done what I wanted to do in this business, and now it's my turn to give them something back."
Which means he'll pull off his No. 52 uniform for the last time after the Ravens are eliminated or win the Super Bowl.
"It's either hold on to the game and keep playing and let my kids miss out on times we can be spending together," Lewis said. "Because I always promised my son if he got a full ride on scholarship, Daddy is going to be there. I can't miss that."
Lewis could have made the announcement during the offseason, but thought it best to do it now.
"I think my fans, my city, I think they deserved for me to just not walk away," he said. "We all get to enjoy what Sunday will feel like, knowing that this will be the last time 52 plays in a uniform in Ravens stadium."
Information from ESPN Stats & Information and The Associated Press was used in this report.