The Baltimore Ravens turned linebacker Ray Lewis’s final home game into a going away party, sending off the future Hall of Famer with a 24-9 victory over the Indianapolis Colts in the first round of the AFC playoffs Sunday.

Lewis announced early last week that he would retire at the end of this season, ending a 17-year career that included 13 Pro Bowl selections and two awards as defensive player of the year. The announced crowd of 71,379 at M&T Bank Stadium crowd went into a frenzy when Lewis did his customary dance as he emerged from the tunnel after coming out of the tunnel, and other defensive starters stood by to watch their middle linebacker instead of heading to the sideline.

“I knew how it started, but I never knew how it was going to end here in Baltimore,” said Lewis, who entered on offense as a running back for the final snap, did a victory dance near midfield and circled the stadium acknowledging fans when time expired. “So for it to go the way it went today, I wouldn’t change nothing.”

With a franchise playoff record 145 yards and a touchdown, wide receiver Anquan Boldin helped ensure that his teammate’s season would continue in the conference semifinals next weekend against the top-seeded Denver Broncos. Lewis was playing for the first time since he was sidelined Oct. 14 with a torn right triceps.

Baltimore quarterback Joe Flacco also did his part, throwing for 282 yards and two scores on 12-for-22 passing without a turnover (125.6 rating), and rookie running back Bernard Pierce amassed 103 yards on 13 carries. The Colts’ only scoring came via three field goals by place kicker Adam Vinatieri.

“It was a lot of energy in the stadium, and Ray coming out of the tunnel obviously even added to that,” Flacco said. “It was a pretty special moment.”

When Boldin caught an 18-yard touchdown with 9 minutes 14 seconds left to seal the victory, anticipation could begin for a rematch against the Broncos, who won in Baltimore, 34-17, on Dec. 16. That was the same week Lewis began practicing fully after his injury.

He’s a heck of a football player,” Ravens Coach John Harbaugh said. “It’s always so funny to hear people say, ‘Well he’s not the same as he was 10 years ago.’ Who is, you know? None of us. But he’s found different ways to play the game, and play it so well. He’s still a great football player.”

The Ravens’ fourth win in 11 tries against Indianapolis also featured the return of Colts Coach Chuck Pagano to Baltimore. Pagano was the Ravens’ defensive coordinator in 2011 before leaving for Indianapolis, where his well-documented battle with leukemia this season engendered league-wide support for the “Chuckstrong” movement.

While Pagano received treatment this season, offensive coordinator Bruce Arians served as interim coach for 12 games, and he continued to call plays when Pagano came back for last week’s regular season finale. But Arians was in a Baltimore hospital Sunday with what a team spokesman characterized as nausea and headaches, leaving quarterbacks coach Clyde Christiansen to call plays.

The Colts managed 419 yards of offense, but much of that came with Baltimore in soft coverage protecting a comfortable lead. Colts quarterback Andrew Luck completed 28 of 53 passes for 288 yards. The No. 1 overall pick also threw an interception when the ball bounced off wide receiver Reggie Wayne’s hands into the waiting arms of Ravens cornerback Cary Williams late in the fourth quarter.

The first half ended with both teams exchanging points after long gains. The Ravens (11-6) started the scoring after a 47-yard catch and run by Ray Rice, who collected Flacco’s short throw and broke loose to the 2. Fullback Vonta Leach finished the series by just crossing the goal line as linebacker Pat Angerer and safety Antoine Bethea converged on him.

Indianapolis (11-6) took possession at its 20 with 50 seconds to play in the half, and a pair of passes to Wayne brought the Colts to the Baltimore 31. The Colts used their second timeout before Luck threw incomplete and was called for intentional grounding one play later.

On third and 26, Luck threw a short out to T.Y. Hilton, and the rookie wide receiver picked up 25 yards to the Ravens 34. Vinatieri connected on a 52-yard field goal as time expired to draw Indianapolis to within 10-6.

“It’s real tough,” Colts defensive end Dwight Freeney said. “You put everything in all year, and the outcome is not what you expect. We had a great year. We accomplished a lot this year. Obviously it’s not where we want to be.”