Rivers overcame two interceptions, including a 31-yard return for a touchdown by Glover Quin, to complete 35 of 42 passes for 404 yards and two touchdowns.
The Chargers' future in San Diego is uncertain, with ownership looking to bolt to the Los Angeles area, perhaps as soon as 2016.
"We couldn't be much worse in that first half. We just couldn't get going and when we did we threw it to them," Rivers said.
It was 21-10 at halftime, and Rivers had just thrown an interception in the end zone.
"I was just so mad with the interception that I didn't know what the score was," he said.
"We felt like we had them on the ropes and they were not going to stop us unless we just didn't execute," Rivers said. "We were able to keep it rolling."
"No one blinked being down at the half," Barksdale said.
"Down 21-3, that can be a dagger," second-year center Chris Watt said. "But we stuck together, which is huge, and played them really tough."
Sacked twice in the first half, Rivers was unscathed in the second.
"We had some pressure on him the first half quite a few times," Detroit coach Jim Caldwell said. "The second half we didn't get to him much. There were a lot of quick screens on the outside that we didn't run down."
But the second half was all San Diego. Rivers threw a 12-yard touchdown pass to Stevie Johnson and rookie Josh Lambo kicked a 25-yard field goal to close to one point. The go-ahead TD pass to Green came with 11:49 to play.
"When you have fun like we did today it didn't feel like a job," Allen said. "He probably looked at me more" without Gates.
"When you come out in the third quarter, you can't turn the ball over twice and not score any points," said Stafford, who was 19 of 30 for 246 yards and two touchdowns, with two interceptions. "That's tough."
Rookie Ameer Abdullah scored easily on his second run, a 24-yarder. Quin's interception return on a poor decision by Rivers and Ebron's touchdown catch made it look as if it was going to be a blowout.
Woodhead also scored on a 1-yard run with 2:33 left in the game for a 33-21 lead.
Copyright 2015 by The Associated Press