Josh McDaniels was the 49ers’ top choice and could have had the 49ers’ coaching job before backing out Monday, according to a report from the San Francisco Chronicle’s Eric Branch.

Patriots offensive coordinator Josh McDaniels withdrew his name from consideration today from the 49ers’ head-coach opening, which was “his if he wanted it,” a source said. …(McDaniels) had a “change of heart” after going through the interview process, the source said. McDaniels was sincere today when he spoke highly of the 49ers’ interview team, which was headlined by CEO Jed York and executives Paraag Marathe and Brian Hampton, the latter of whom leads their analytics department.

McDaniels on Monday officially withdrew his name from consideration to succeed Chip Kelly, who was the 49ers’ second-straight one-and-done coach following a 2-14 finish to 2016.

It was reported by the Chronicle earlier this month that San Francisco was McDaniels’ preferred coaching destination if he elected to leave New England. He also interviewed with the Rams and Jaguars, who hired Sean McVay and Doug Marrone, respectively.

McDaniels will stay with the Patriots in 2017 and won’t have to uproot his family. He has four children, who were a leading factor in McDaniels feeling “conflicted” about taking the job, according to a report from Pro Football Talk that surfaced Sunday.

McDaniels said in a conference call on Monday: “I was really impressed with Jed York and Paraag [Marathe], and Brian, and people that came for the 49ers organization. They did a great job with their presentation. Again, humbled to be included in that process. At this time, it’s just best for my family and myself to remain here in New England, and focus on this year’s playoffs and finish out the year however it turns out.”

The 49ers’ remaining two candidates are Falcons offensive coordinator Kyle Shanahan – the clear favorite – and Seahawks offensive line coach Tom Cable, who was interviewed Sunday.

Related Chip Kelly interviewing for Jaguars offensive coordinator job

Shanahan cannot be hired until the Falcons’ postseason run is over. They’ll host the NFC Championship Game Sunday against the Packers after beating the Seahawks in the divisional round on Saturday, 36-20.

It was an impressive performance for Shanahan’s offense against the 49ers’ chief rival. The Falcons had 422 yards of offense after leading the NFL in scoring and finishing the regular season second in yardage.

The 49ers can’t schedule a second interview with Shanahan until next week. They could hire him at any time if Atlanta loses to the Packers, but would have to wait until after the season’s to hire him over if the Falcons make it to the Super Bowl.

Cable could be hired at any time since Seattle was eliminated from the playoffs over the weekend.