Kyle Shanahan is entering his seventh season as head coach of the San Francisco 49ers, and he has enough self-awareness to realize when he has made a mistake.

On Thursday, Shanahan apologized for being a "jerk" to defensive lineman Maxx Crosby. 

The Niners coach was referring to how he treated Crosby during the process leading up to the NFL Draft.

"He’s as good as it gets and wanted to apologize to him because we were kind of (jerks) to him in our interview when he came out of (Eastern Michigan)," Shanahan said. "He’s one of the coolest dudes I’ve been around and seen and one of the best players in this league."

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Kyle Shanahan of the San Francisco 49ers reacts during a game

Head coach Kyle Shanahan of the San Francisco 49ers reacts against the Kansas City Chiefs during the second quarter in Super Bowl LIV at Hard Rock Stadium Feb. 2, 2020, in Miami, Fla. (Tom Pennington/Getty Images)

Shanahan's admission came the same day of the 49ers' joint practice with the Raiders in Henderson, Nevada.

JIMMY GAROPPOLO ADMITS 49ERS DRAFTING TREY LANCE IN 2021 MADE 'REAL AWKWARD' DYNAMIC

Crosby was drafted by the Raiders in the fourth round in 2019. He has since developed into one of the league's top pass rushers.

He has 37½ career sacks, including 12½ last season.

Maxx Crosby speaks during a press conference

Defensive end Maxx Crosby of the Las Vegas Raiders speaks at a news conference after the first practice of the team's training camp at the Las Vegas Raiders Headquarters/Intermountain Healthcare Performance Center July 26, 2023, in Henderson, Nev.  (Ethan Miller/Getty Images)

"I feel like every single team that I interviewed with didn’t take me seriously," Crosby said. 

"I can name every team if I want, but I’m not going to do that. But Kyle Shanahan is an incredible coach. The dude is literally one of the best play-callers in the game, so I’ve got a massive amount of respect for him. We played against them last year, and they gave me all type of looks."

Maxx Crosby rushes the quarterback

Maxx Crosby (98) of the Las Vegas Raiders rushes the quarterback during a game against the Los Angeles Rams at SoFi Stadium Dec. 8, 2022, in Inglewood, Calif. (Kevin Sabitus/Getty Images)

Crosby added that his draft experience helped shape him into the player he is today.

"I remember everything, trust me. I remember all those interviews, but that’s what makes me who I am today. I carry every little scar. I won’t talk about a lot of it, but I keep everything noted."

CLICK HERE TO GET THE FOX NEWS APP

The Raiders host the 49ers Aug. 13 to open the preseason.

The Associated Press contributed to this report