LOS ANGELES — Just three weeks ago, the Buffalo Bills were 0-2 and Rex Ryan appeared to be headed directly for trouble.

Ryan and his Bills emerged from the Coliseum on Sunday with their first three-game winning streak in a half-decade and every reason to think this once-problematic season can be memorable.

With their 30-19 victory over the Rams, the Bills (3-2) kept pace in the AFC East race. After LeSean McCoy rushed for 150 yards and cornerback Nickell Robey-Coleman grabbed two interceptions, Ryan acknowledged that his team has found its groove, and in plenty of time to save its season.

“It feels great,” Ryan said. “You know me, I’m just an average coach, very rarely won three straight games, so it feels great. We’ve just got to go for four now.”

The Bills hadn’t won three straight since winning the first three contests of the 2011 season, which ended 6-10. Buffalo’s three-week turnaround is remarkable, but it played out logically in front of the stadium featuring a large contingent of long-suffering Bills fans eager to see their team in the Coliseum for the first time since a game against the Raiders in 1992.

The defense produced its third consecutive strong performance, limiting the Rams to 345 yards and just one touchdown while forcing three turnovers even without defensive lineman Marcell Dareus, a late scratch after injuring his hamstring Friday.

Robey-Coleman made the biggest plays, returning one of his picks for a touchdown in the stadium where he played his college ball. The Bills’ plus-9 turnover margin is among their greatest assets, Ryan said.

“I think the big deal is you’re seeing 11 guys out there playing as one,” Ryan said. “They don’t want to let each other down, and I think that’s a great thing. … It has nothing to do with individual glory and all that. I think we’ve sold out to just being a team and I think that’s how we’re playing.”

The Bills’ offense was led by Tyrod Taylor — who passed for two touchdowns and made enough big plays to counteract a few regrets — and McCoy, who tore through a Los Angeles defensive line missing three starters. Buffalo didn’t overwhelm the depleted Rams, but capitalized on several opportunities for a comfortable win.

“I could have easily have had over 200 yards,” McCoy said.

That confidence is worlds away from the Bills’ state just three weeks ago, when a 37-31 loss to the New York Jets prompted Ryan to fire offensive coordinator Greg Roman. Buffalo hasn’t lost with newly promoted coordinator Anthony Lynn in charge, but McCoy believes the praise should go to the entire offense.

“It wasn’t a dominating performance by our offense, or a dominating performance by our defense or special teams,” McCoy said. “It was all together. That’s a big win.”

The Bills didn’t dominate the Rams, but they proved to be resourceful on both sides of the ball. That adaptability is a key to the three-game resurgence under Ryan.

After consecutive wins over Arizona, New England and Los Angeles, the Bills’ schedule gets theoretically easier for the next two weeks, making a 5-2 start looked eminently possible. Buffalo returns home to host struggling San Francisco before traveling to Miami.

“It’s gratifying for the moment, but man, we know we’ve got a ton of work in front of us,” Ryan said. “The gratification will come, obviously, if we’re fortunate enough to do what our plans are. But right now, we’ve got a flight home. Maybe it will be gratifying on the way home. I’ll overeat, like always, but that’s it.”

AP NFL websites: www.pro32.ap.org and www.twitter.com/AP_NFL