Former New York Jets Coach Rex Ryan has reached agreement with the Buffalo Bills, replacing Doug Marrone, the Associated Press reported. Quoting sources, the AP said agreement was reached after two days of discussions.

Ryan, who spent 22 years as an assistant coach before landing the top job on the Jets in 2009, was one of 14 candidates for the job by Bills' new owners Terry and Kim Pegula, the Syracuse Post-Standard reported, and will be the sixth Bills coach since Wade Phillips was canned after the 2000 season. The Bills finished the 2014-15 campaign 9-7, their best record in a decade, but didn't make it to the playoffs for the 15th straight season, an NFL record.

Ryan was fired by the Jets following a 4-12 season and after compiling an overall 50-52 record, including 4-2 in the playoffs.

His job on the Bills will be to beef up the offense, which finished 26th in yardage for the season. Quarterback is a concern following the benching of second-year starter EJ Manuel, the announced retirement of Kyle Orton and no 2015 first-round draft pick. Manuel has two years left on his contract.

The Bills also are reported to be taking to San Francisco Forty-Niners offensive coordinator Greg Roman about the offensive coordinator position on the Bills, the AP said, though NFL Network said Ryan is pushing for ex-Chicago Bears Coach Marc Trestman.

ESPN reported it will be Roman's job to make sure Ryan doesn't run into the same problems he faced with the Jets and his inability there to square away the quarterback situation. Roman is said to share a similar philosophy to Ryan's, making him a good fit.

Ryan's father, Buddy, had ties to Buffalo as well. He served as assistant coach at the University of Buffalo from 1961 to 1965. The elder Ryan also was head coach of the Philadelphia Eagles and Arizona Cardinals while Rex Ryan's fraternal twin brother is the defensive coordinator of the New Orleans Saints.