San Francisco Coach Kyle Shanahan speaks after a loss to Arizona earlier this month. (Ross D. Franklin/AP)

It has been four years since Kyle Shanahan scripted plays for the Washington Redskins' offense, but his imprint lingers on two of the team's stalwarts. Quarterback Kirk Cousins and tight end Jordan Reed feel indebted for the steadiness Shanahan provided as a young coordinator when they weren't sure, as mid-round NFL draft picks, how or even whether they'd fit on the Redskins' roster.

"Kyle believed in me when it was just potential; there was no production," said Cousins, 29, who went on to set back-to-back franchise records for passing yards in a season. "I hadn't done anything to earn his belief, and he believed in me."

Added Reed, 27, a 2016 Pro Bowl honoree: "He gave me confidence in myself. I wasn't a big tight end, so he didn't have me doing big-tight-end things. He had me doing things that fit my skill set."

For Shanahan, 37, his experience in Washington lingers, as well. Now head coach of the San Francisco 49ers, he routinely draws on lessons from his four-year tenure as Redskins offensive coordinator under his father, Mike Shanahan — a tumultuous span during which he worked with five starting quarterbacks, weathered feuds and turf wars, was hailed as the mastermind of Robert Griffin III's brilliant rookie season and then blamed for undermining his career, was part of just one winning season and learned to steel himself against criticism, whether fair, unfair, misplaced or on point.

"I got extremely battle-tested in Washington," Shanahan said during a conference call this week. "To be in a place like the market they had, to have the same last name as the head coach, to where every time someone talks about the team they say 'the Shanahans' and add an 's' to the end. So I think I went through some stuff as a coordinator that most people don't go through until they become a head coach."

On Sunday, Shanahan returns to FedEx Field hoping to extract something other than battle scars from the experience: his first victory as an NFL head coach.

There will be no shortage of motivation on either side when the Redskins (2-2) host the 49ers (0-5), who have lost their past four games by a total of 11 points and lost their past two in overtime .

Coach Jay Gruden's Redskins hope to vindicate their claim that they're better than a .500 squad and have the mettle to seize an opportunity to separate themselves as the injury-depleted, 0-5 New York Giants implode and the Dallas Cowboys (2-3) try to right their season for the next six games without running back Ezekiel Elliott, whose NFL suspension was reinstated Thursday.

Rested from their bye week, the Redskins will be without top cornerback Josh Norman, who fractured a rib in an Oct. 2 loss at Kansas City, and may be without five-time Pro Bowl left tackle Trent Williams (knee), the anchor of an offensive line that has allowed just seven sacks to date. And they need to guard against taking the 49ers too lightly.

"If you overlook them, you will lose the game," NFL analyst Daryl Johnston, who will call Sunday's game for Fox Sports, warned in a telephone interview. "When you watch them on film, they don't look like an 0-5 team. It really has been a handful of plays" that have made the difference.

Shanahan's 49ers remind Johnston of the steep learning curve the Cowboys faced in 1989, his rookie season, trying to figure out how to win with a first-year NFL owner (Jerry Jones), new head coach (Jimmy Johnson) and new quarterback (rookie Troy Aikman).

The 2017 49ers, in a similar vein, are being led by a first-time general manager (John Lynch) and their fourth head coach in as many years (Shanahan succeeds Chip Kelly, who succeeded Jim Tomsula, who followed Jim Harbaugh).

"When you go through a transition like the 49ers are, there's definitely a learning curve," Johnston said. "We were 1-15 in 1989, and it was probably halfway through 1990 before we saw the dividends of our hard work. All the sudden, you win that [first] game, you believe you can win."

What impresses Johnston about Shanahan, who helped turn Atlanta into an offensive power in 2015 and Matt Ryan into an NFL MVP in 2016, is his inventiveness in creating mismatches with his three-wide-receiver sets and his guile in disguising the intent of his plays by tinkering with his backfield.

"I think they'll be good," Johnston said. "And I think they're going to be good in a relative short amount of time."

Though widely regarded as a bright, if headstrong, offensive mind, Shanahan stepped into an undesirable job in San Francisco, given the turmoil in the coaching and front office ranks, the lack of a franchise quarterback and a roster that needed an upgrade.

The rebuild of what once was an NFL dynasty, no doubt, will take time.

But Shanahan has been preparing for that challenge since Chris Simms met him nearly 20 years ago, as college teammates at Texas.

"I was on a mission to be an NFL quarterback, and he was on a mission to be an NFL head coach," Simms recalled of his former Longhorns wide receiver, now best friend, in a telephone interview. "We talked football and the nuances of football all the time."

It went well beyond talk with Shanahan, according to Simms, now a co-host on "PFT Live" and a Notre Dame football analyst for NBC. Shanahan was far from a brash, entitled NFL coach's son, recalls Simms, whose own father was a Super Bowl MVP quarterback, but a grinder who was super-serious about perfecting his craft even though it was clear his future probably wasn't as an NFL receiver.

As Simms recalled, Shanahan honed his skills after practice doing route-running drills he had pilfered from Denver's star wide receivers at the time, Ed McCaffrey and Rod Smith. He studied the intricacies of plays, invented his own and got aggravated when he didn't win Madden Xbox games with his prowess. "He tried to approach it like a real head coach and say, 'That play should work!' " Simms recalled. "When he puts his mind to something, he becomes obsessed with it: OCD to the 10th degree!"

Gruden first crossed paths with Shanahan when Kyle was an offensive quality-control coach on the Tampa Bay Buccaneers' staff in 2004, his second job out of college, and Gruden, then playing and coaching in the Arena Football League, was a part-time assistant on his brother Jon's staff. He recalls Shanahan, 13 years younger, as a go-getter, doing the coaches' grunt work and typing his notes in his office. "He was a very bright guy," Gruden said. "Good guy."

After Tampa Bay, Shanahan went to Houston and climbed the ranks from wide receivers coach to quarterbacks coach to offensive coordinator, turning the Texans into a top-five offense in 2008 and 2009.

In his four seasons in Washington, the Redskins offense ranked 18th, 16th, fifth and ninth with a medley of quarterbacks — Donovan McNabb, Rex Grossman, John Beck, Griffin and Cousins — directing the attack before both he and his father were fired after the 3-13 season in 2013.

"I feel like I had to go through a bunch of stuff that wasn't always fun," Shanahan said, asked about his Redskins tenure, "but it's something that I never regret and wouldn't take it back for anything because I think it has made me a better person, a better coach and prepared me more to be good where I am at."