—The Baltimore Ravens , in an NFL season of prolific offense, used their defense Sunday to earn a trip to New England for the AFC title game.

Two early touchdown passes by quarterback Joe Flacco provided all the offense the Ravens needed and they held on to beat the mistake-prone Houston Texans, 20-13, in a conference semifinal at M&T Bank Stadium.

The second-seeded Ravens will face the top-seeded Patriots next Sunday with a Super Bowl spot at stake.

“I think it was a Raven-type victory,” linebacker Terrell Suggs said after the Ravens limited the Texans to a second-quarter touchdown run by tailback Arian Foster and a pair of field goals. “I always say there’s a right way to do things and a wrong way to do things, and then there’s a Raven way to do things. It wasn’t really pretty but hey, we’re not really a pretty team.”

The Ravens raced to a 17-3 lead in the first quarter, converting a pair of Texans turnovers into Flacco’s two touchdown passes. That was it for the Ravens’ offensive production until kicker Billy Cundiff connected on a 44-yard field goal with just less than three minutes to play.

Ravens free safety Ed Reed intercepts a pass intended for Houston Texans wide receiver Andre Johnson during the second half. (Patrick Semansky/Associated Press)

But that was all the Ravens needed because the third-seeded Texans, after pulling to within 17-13 at halftime, couldn’t score in the second half. Foster ran for 132 yards, but rookie quarterback T.J. Yates threw three interceptions, two to Ravens cornerback Lardarius Webb.

The Texans, seeking a tying touchdown late in the fourth quarter, drove to the Baltimore 38-yard line. But on the first play after the two-minute warning, Yates’s deep throw, intended for wide receiver Andre Johnson, was intercepted by Ravens safety Ed Reed. It was the Texans’ fourth turnover of the game.

“We feel like we’re the big brother . . . of the team,” Reed said of the defense, “but our offense will get going. . . . It’s not going to always be a blowout or a shootout game. It’s going to be hard-fought.”

The Texans had one more possession, which began at their 48-yard line in the game’s final minute, But Yates threw a fourth-down incompletion on a desperation pass toward the end zone with 11 seconds left. Reed was helped off the field by members of the Ravens’ medical staff after he turned his ankle on that play. But he vowed to be ready to face the Patriots.

“You win the game no matter what,” Ravens Coach John Harbaugh said. “That’s really what it boils down to in a situation like this. . . . It wasn’t perfect by any stretch.”

Harbaugh joined his brother, San Francisco 49ers Coach Jim Harbaugh, in the NFL’s final four, a day after the 49ers advanced to the NFC championship game. The Ravens got their first playoff victory at home since Dec. 31, 2000. Their previous seven postseason games had been played on the road. They hadn’t played at home during the playoffs since a January 2007 loss to the Indianapolis Colts.

This was a rematch of a regular season game won here in October by the Ravens. That was two starting quarterbacks ago for the Texans, who lost starter Matt Schaub and top backup Matt Leinart to season-ending injuries and went with rookie third-stringer Yates. The Texans lost their final three regular season games but rebounded to beat the Cincinnati Bengals in the first playoff game in franchise history.

“You’ve got a group of guys in there right now that knows we were a couple mistakes away from winning,” Texans Coach Gary Kubiak said

In their first-ever road playoff game, the Texans got off to a promising start when Danieal Manning returned the opening kickoff 60 yards. That set up kicker Neil Rackers’s 40-yard field goal.

The Texans turned generous from there. A muffed punt by Jacoby Jones gave the ball to the Ravens at the Houston 2-yard line. That led to Flacco’s one-yard touchdown pass to tight end Kris Wilson.

The Ravens managed to get a 48-yard field goal by Cundiff without assistance from the Texans. But then Yates threw a pass, intended for Johnson, directly to Webb for his first interception. That gave the Ravens possession at the Houston 34-yard line, and they cashed in with Flacco’s 10-yard touchdown pass to wide receiver Anquan Boldin.

“They’re a good defense,” Flacco said. “You have to be patient sometimes with them. We got some turnovers early on that allowed us to put the ball in the end zone. . . . That ended up being a pretty big part of the game.”

The Texans got back into the game in the second quarter behind Foster, who had 95 first-half rushing yards. Rackers’s 33-yard field goal narrowed the deficit to 17-6, and a touchdown drive led by Foster pulled the Texans to within 17-13. Foster scored the touchdown on a one-yard run.

Rackers missed a 50-yard field goal attempt in the third quarter, with the ball deflecting off the crossbar. Harbaugh left his offense on the field for a fourth-down gamble from inside the 1-yard line, but tailback Ray Rice was stopped short of the goal line by Texans linebacker Tim Dobbins.

The Texans weren’t faring any better on offense, though, and Yates threw his second interception to Webb midway through the fourth quarter.

“We had ourselves in position,” Kubiak said. “We just couldn’t close the deal.”