Rex Ryan needed just one more win — against the faltering Jets, no less — to become the first Buffalo Bills head coach in 16 years to post back-to-back .500 seasons.

As it turns out, he will not be afforded that opportunity on Sunday, when the N.F.L. concludes its regular season. In a move that was surprising more for its timing than its outcome, Ryan was fired Tuesday and replaced by his offensive coordinator, Anthony Lynn, on an interim basis.

Ryan still has three years left on a five-year deal worth $5.5 million per season, an indication of just how badly the Bills’ owners, Terry and Kim Pegula, wished to be rid of the boisterous Ryan. The dismissal had been rumored for more than a week, though the Bills had been expected to wait until the so-called black Monday, the day after the regular season ends, to pull the trigger.

Instead, Ryan, 54, was dumped sooner than later, along with his brother, the defensive coordinator Rob Ryan, after a particularly demoralizing 34-31 overtime loss to the Dolphins on Saturday.