It was fitting that the champion of the imperfect NFC East was crowned Saturday night in a boo-fest of a game that will be remembered for points unscored by both teams.

Quarterback Kirk Cousins threw for four touchdowns, and safety DeAngelo Hall added another as the Washington Redskins overcame a costly quarterback gaffe late in the first half to beat the Philadelphia Eagles, 38-24.

With the victory, set to a soundtrack of boos from an Eagles crowd that started out jeering the visitors then turned on its own, the Redskins won the NFC East for the first time since 2012 and only the second time in the past 16 seasons.

As division champions, the Redskins will host a playoff game Jan. 9 or 10 at FedEx Field, with Seattle (9-5), Green Bay (10-4) or Minnesota (9-5) their likely opponent.

Saturday’s victory, and the turnaround it represented for a franchise that had won just seven games the previous two seasons, was a vindication of Coach Jay Gruden’s decision to put his offense in the hands of Cousins, convinced his upside outweighed the sketchy résumé the quarterback had compiled over three seasons of spot duty in relief of Robert Griffin III.

The Washington Post's Gene Wang and Scott Allen discuss the Redskins' division-clinching win over the Philadelphia Eagles. (Thomas Johnson,Randolph Smith/The Washington Post)

It was also a validation of Scot McCloughan’s first season as Redskins general manager — specifically, the tough-nosed identity he sought to instill through his draft picks and free agent acquisitions and the stability he has tried to introduced to a franchise notorious for turmoil.

After starting the 2015 season 2-4, Washington has now won four of its past five and is assured of finishing at least .500. With the Jan. 3 regular season finale remaining, the Redskins have won more games this season (eight) than they did the past two seasons combined (seven).

Cousins finished 31 of 46 for 356 yards and four touchdowns — including a pair to tight end Jordan Reed, who eclipsed the single-season record for receiving yards by a Redskins tight end in the process.

Washington’s offense outgained Philadelphia’s quick-strike attack 418 yards to 398. Neither team ran the ball with authority. Washington rushed for 67 yards; Philadelphia, 45.

And the Redskins defense bent but didn’t fold while focusing on frustrating quarterback Sam Bradford (37 of 56 for 380 yards and one touchdown). Rookie linebacker Preston Smith accounted for three of Washington’s five quarterback sacks. Bradford was his own worst enemy in stretches, badly overthrowing a sure-fire touchdown when a defensive miscue by Washington left tight end Zach Ertz wide open.

The Redskins’ victory was in question throughout the early going — and never more so than after the costly gaffe by Cousins. With six seconds remaining in the first half, a six-point lead and the ball on the Philadelphia 6, the Redskins’ safest play would have been to kick a field goal. Gruden wanted to take a shot at scoring a touchdown, however, so he called for a fade to wide receiver Pierre Garcon in the end zone.

Cornerback DeAngelo Hall picks up a DeMarco Murray fumble and returns it for a third-quarter touchdown that put some distance between the Eagles and Redskins. (Toni L. Sandys/The Washington Post)

Cousins inexplicably kneeled instead, which squandered the remaining seconds, ended the period and baffled Gruden, as well as everyone on the field, in the stands and watching on TV.

The Redskins took a 16-10 lead into halftime, but it felt as if the momentum belonged to the Eagles, beneficiaries of one of the more puzzling blunders in NFL annals.

From that point, the question turned to Cousins and how he would respond to his nationally televised embarrassment. Cousins’s ability to shake off setbacks had been key to his improvement in his first year as an NFL starter. But with a playoff berth resting on Saturday’s outcome, there was reason to wonder if he’d unravel.

After both teams traded fruitless drives to open the second half, Cousins drove the Redskins 54 yards, firing a 12-yard strike to running back Chris Thompson to get his team back on track.

“I’m very proud of Kirk,” said Gruden, sporting an NFC champions cap afterward. “We had the debacle at the end of the half. A normal guy could have gone in the tank there. But he kept his composure — just like he has all year, just like he has his whole career — kept his nose to the grindstone, kept battling and competing.”

Cousins has now thrown 26 touchdowns to 11 interceptions this season.

The Eagles countered, with DeMarco Murray carrying four yards for a touchdown that made the score 23-17 and gave the crowd new life.

Eagles fans were still fist-pumping when Murray fumbled on Philadelphia’s next drive and Hall swooped in to scoop up the ball and run it back 17 yards for a touchdown that extended the Redskins’ lead to 30-17.

Cousins’s fourth strike, to Garcon, started the exodus of Eagles fans with 8 minutes 55 seconds remaining. Washington’s two-point conversion, to compensate for a missed extra point earlier in the game, made it 38-17.

The victory gave the Redskins a season sweep of the Eagles.

It’s the first time since 1999 that the Redskins have locked up a playoff berth before the final week of the season. Picked by most prognosticators to finish last in the division, the Redskins are an improbable playoff team.

They have clinched a spot in the postseason without beating a single team that currently has a winning record. And they did so after losing 14 players — more than one-fourth of a 53-man NFL roster — to season-ending injury.

Gruden noted the contributions of free agents signed midseason, along with those of the team’s rookies and veterans, for the turnaround. “They really have withstood a lot,” Gruden said.

The Eagles set a dominant tone out of the gate, marching 80 yards in six plays. They were helped by a 23-yard pass interference call on cornerback Will Blackmon that advanced the ball to the 1. Ryan Mathews carried the final yard for the score.

With Washington’s offense going three and out, the defense was back on the field after less than 60 seconds had ticked off the clock.

The Redskins soon replied with a 69-yard drive that featured Reed (nine catches, 129 yards, two touchdowns), who grabbed completions of 28 and 22 yards. The latter, a leaping catch in the center of the end zone, was his 10th touchdown reception of the season. But Dustin Hopkins’s extra point sailed wide, making it 7-6.

Cousins found Reed again for Washington’s next score, which put the Redskins up 13-7.