LANDOVER, Md. -- It wasn't just a hard-hitting defense that emphatically broke the 49ers' two-game losing streak Monday night.
Their passing game awoke from its slumber, with Colin Kaepernick producing three touchdown passes and a career-best passer rating to complement the 27-6 win over Washington.
"We didn't sugarcoat it this week: We knew it was a game we had to have," said 49ers wideout Anquan Boldin, who had two touchdown catches. "We're right in the hunt with everybody else, and we feel like our best is ahead of us."
The 49ers (7-4) remain tied with the Arizona Cardinals for second place in the NFC West behind the idle Seattle Seahawks (10-1).
Kaepernick set a career high with a 134.5 passer rating, completing 15 of 24 passes for 235 yards with the three touchdowns and no interceptions. He eclipsed the 200-yard mark for only the third time this season, a positive sign after mustering just 218 yards combined in the aforementioned two-game losing streak.
While Kaepernick triumphantly emerged from his recent swath of criticism, Washington counterpart Robert Griffin III certainly did not.
Coordinator Vic Fangio's defense repeatedly rattled and pummeled Griffin. The stat sheet says he got sacked just four times -- twice each by Aldon Smith and Ahmad Brooks -- but 49ers coach Jim Harbaugh figured Justin Smith also will end up with two sacks upon further review.
"Any time you get a chance to hit a quarterback, you want to take that shot," linebacker NaVorro Bowman said.
Griffin's punishment aside, the 49ers defense set the second half's tone when it stopped Washington on fourth-and-2. There, at the 49ers' 41-yard line, Roy Helu Jr. got stopped a yard shy of the chains by Patrick Willis, Donte Whitner and Bowman.
The 49ers clung to a 10-6 lead at that point, and Vernon Davis had just fumbled their opening series after halftime. Davis and the offense surged to life once they got the ball again -- and Davis eventually made amends for his turnover by catching a 1-yard touchdown pass for a 24-6 lead.
"That was the toughest defense we've gone against this year," said Washington coach Mike Shanahan, whose team fell to 3-8 with a third straight loss.
Boldin's second touchdown catch put the 49ers comfortably ahead 17-6, and while it came on a broken play, it followed his 32-yard reception on a fantastic, back-shoulder pass by Kaepernick on third-and-7.
"There was execution and precision there," Harbaugh said.
Harbaugh said he told Kaepernick last week how impressed he was with his leadership and a demeanor that was both "loose and focused."
Griffin got bashed in Washington all week for his questionable leadership and accountability. On Monday night, it was his on-field performance that drew boos, though Bowman gave him credit for trying to play through a still-sore knee.
Griffin's first-half passing line: 1 of 6 for minus-1 yard with an interception on a 15-yard pass right into Whitner's hands. Washington produced only one first down in the second half, unable to rally behind Griffin and Alfred Morris.
"It was a combination of both their defense and we didn't play well," Griffin said, who got hit seven times, according to the stat sheet. "It is frustrating, but we had opportunities."
That's what the 49ers finally accomplished with their offense, one that sputtered in losses to the Carolina Panthers and New Orleans Saints the previous two games.
The 49ers showed promising signs of a breakout game when they took a 10-0 lead behind Boldin's 19-yard touchdown catch and Phil Dawson's 29-yard field goal.
But that lead got cut to 10-6 lead by halftime, so "we had to come out and put points on the board," Kaepernick said.
By accomplishing that, Kaepernick said, the 49ers took a step in the right direction.
"It was one we had to have," Harbaugh said. "We came a long way to get it. Our guys spent a lot of energy and toughness to get it. It's going to be like this every week."
St. Louis (5-6) at 49ers (7-4), 1:05 p.m. FOX
Michael Crabtree expected to activated by Tuesday deadline. Page 4
Hometown kid Vernon Davis enjoys big game. Page 4