OAKLAND, Calif. (AP) — Just when Oakland’s seemingly safe lead appeared to be slipping away, Terrelle Pryor turned a broken play into a big one that helped seal the victory.

Pryor threw two touchdown passes in the first quarter and then set up a late field goal by turning a potential sack into a third-and-long conversion that gave the Raiders a 27-17 victory over the San Diego Chargers on Sunday night.

“That’s what the kid brings to us,” coach Dennis Allen said. “Terrelle brings that ability when things aren’t right, when things break down, he brings that ability to make plays.”

Charles Woodson tied an NFL record with his 13th defensive touchdown and then sealed the win with a late interception as the two most popular Raiders turned this rare late-night start into a celebration.

Pryor got the Raiders (2-3) off to a fast start in the latest West Coast game in NFL history with a 44-yard touchdown pass to Rod Streater on Oakland’s first play from scrimmage. The young quarterback completed his first 10 passes and led TD drives on the first two possessions, also connecting with Denarius Moore.

The Raiders then used five turnovers, a goal-line stand, Woodson’s 25-yard return of Danny Woodhead’s fumble and two long field goals by Sebastian Janikowski to beat the Chargers (2-3).

“That definitely builds confidence, but you have to keep striking,” Pryor said. “I’m excited we started fast and got the win.”

Philip Rivers had his third 400-yard passing game of the season, throwing for 411 yards and two touchdowns. But he also had three interceptions as the Chargers played without injured starting offensive linemen King Dunlap and Chad Rinehart.

They also lost running back Ryan Mathews to a concussion in the first half.

“We came out and we were outplayed in all three phases,” coach Mike McCoy said. “It’s tough to go on the road and turn the ball over the way we did and win a football game on the road against a good football team. Too many big plays.”

The Raiders were without starting offensive linemen Stefen Wisniewski and Tony Pashos, as well as running back Darren McFadden. But Pryor and Woodson helped make sure that didn’t matter.

The game was shifted to a late-night start to allow time to convert the Coliseum to its football configuration after the Oakland Athletics played a baseball playoff game here Saturday night. The process took about 18 hours and was completed around 3:30 p.m., more than five hours before kickoff at 8:35 p.m.

The wait was more than worth it for Oakland fans who had plenty to cheer about right from the start as Pryor and the Raiders broke out to a 17-0 halftime lead.

“Digging a 17-0 hole, it’s hard to come back and win,” Rivers said. “We fought — you can’t question the effort — but we obviously didn’t do enough to get it done.”

The Chargers’ first score didn’t come easily as Nick Novak had a 37-yard field goal attempt blocked by Tracy Porter. But Ladarius Green picked up the ball behind the line of scrimmage and ran for a first down. Rivers appeared to throw a touchdown pass to Keenan Allen two plays later but the call was reversed after replay showed Allen got only one foot down inbounds.

That led to a second field goal attempt for Novak and he connected this time from 35 yards to cut Oakland’s lead to 17-3.

The Raiders appeared to break the game open when Woodson scooped up Woodhead’s fumble and ran it in to make it 24-3. That tied him with Darren Sharper and Rod Woodson for the most defensive touchdowns in NFL history.

“He’s made a habit out of doing that his whole career: a defensive score, an interception to seal the game,” Allen said. “That’s what we expect out of him. He’s been a playmaker for us and he’ll continue to be a playmaker for us.”

But Rivers and the Chargers didn’t quit, scoring touchdowns on their next two drives on passes to Woodhead and Allen in the opening 5 minutes of the fourth quarter to cut the deficit to 24-17.

Pryor came up with one more big play, scrambling before hitting Brice Butler on a 20-yard pass on third-and-14. That set up Janikowski’s 50-yard field goal that made it 27-17.

“That’s one of the better things I do, create time,” said Pryor, who went 18 for 23 for 223 yards. “I’m always trying to get better in the pocket.”

NOTES: Oakland’s 17-0 halftime lead was its biggest at home since 2002. … The Raiders had no interceptions coming into the game. … Rivers had three career 400-yard passing games before doing it three times in the past four weeks. … Raiders RB Rashad Jennings left in the first half with a hamstring injury.