BUFFALO, N.Y. — Rex Ryan is staying in the AFC East after reaching an agreement Sunday to coach the Buffalo Bills.

A person familiar with the talks told The Associated Press the former New York Jets coach accepted the Bills’ contract offer after two days of discussions. The person spoke on the condition of anonymity because the Bills have not discussed their search to replace Doug Marrone, who stepped down abruptly Dec. 31.

The offer was made a day after the Bills identified Ryan as a finalist and met with him for a second time in South Florida, where new owners Terry and Kim Pegula live. Ryan was one of 12 candidates to interview for the job since last weekend.

A second person familiar with talks told the AP the Bills are negotiating to hire Greg Roman as offensive coordinator. Roman, a finalist for the Bills’ coaching job, spent the past four years as the San Francisco 49ers’ offensive coordinator. Roman’s future is uncertain in San Francisco after Jim Harbaugh left to coach Michigan.

The Bills went 9-7 to match their best record in a decade but missed the playoffs, extending the NFL’s longest active drought to 15 seasons.

Ryan is very familiar with the Bills after spending the past six seasons coaching the Jets, Buffalo’s AFC East rival. He had a 50-52 record, including 4-2 in the playoffs, with the Jets before being fired along with general manager John Idzik following a 4-12 season.

Ryan’s challenge in Buffalo would be similar to the one he had in New York – providing a spark to a sputtering offense. The Jets were 22nd in total yards – four spots ahead of Buffalo.

The Jets faltered behind second-year quarterback Geno Smith, who was eventually benched and replaced by Michael Vick. In Buffalo, second-year starter EJ Manuel was benched after four games and replaced by 10-year journeyman Kyle Orton, who has since said he plans to retire.

Manuel has two years left on his contract and is the only experienced starter on the roster.

RAVENS: Gary Kubiak has decided to remain Baltimore’s offensive coordinator rather than seek a job elsewhere as a head coach.

Kubiak coached the Houston Texans for eight years before joining the Ravens this season. Under his direction, the Ravens set a franchise record for points in the regular season and advanced to the second round of the playoffs.

Kubiak has been asked to interview for several head coach openings, but won’t follow up.

 Ravens wide receiver Steve Smith cleared up any doubts about his plans for next season, writing on his official Twitter account that he plans to be back for a 15th season.

Smith caught 79 passes for 1,065 yards and six touchdowns in his first season with Baltimore.

STEELERS: Hall of Famer Dick LeBeau, 77, has resigned as defensive coordinator.

LeBeau had been with the organization for 16 seasons, including serving as defensive coordinator from 1995-96 and from 2004-14. He was also the secondary coach from 1992-94.

In his 13 years as defensive coordinator, the Steelers finished in the top five in total defense 11 times and had the top-ranked defense five times.

He was inducted into Pro Football Hall of Fame in 2010.

As a player, LeBeau had 62 interceptions in 14 seasons for the Detroit Lions from 1959-72. He began his 42-year coaching career as a special teams coach with Philadelphia in 1973. He also was an assistant with Green Bay, Cincinnati and Buffalo, and head coach of the Bengals from 2000-02.

LONDON GAMES: Fans of the Bills and Jaguars will need to wake up early on Oct. 25 to watch their teams. Same thing for the followers of the Jets and Dolphins earlier in the month.

The Jaguars will host the Bills at London’s Wembley Stadium in late October, with a 1:30 p.m. local kickoff. That means 9:30 a.m. on the U.S. East Coast.

Three weeks earlier, on Oct. 4, Miami hosts the Jets, with a 2:30 p.m. kickoff, which also translates to 9:30 a.m. ET. London goes off daylight savings time on Oct. 25.

No kickoff time has been announced for the Nov. 1 game at Wembley between Detroit and Kansas City.