– Face down on the turf, Tony Romo pounded his hands into the ground like a petulant child.

Frustrated by yet another season-ending failure? Far from it. The Dallas quarterback was celebrating after giving the Cowboys the lead in a stirring playoff comeback.

Romo threw two touchdown passes to Terrance Williams, the second for the lead late in the fourth quarter, and the Cowboys rallied for a 24-20 wild-card victory over Detroit on Sunday in their first playoff game in five years.

Dallas (13-4) wiped out an early two-touchdown deficit to advance to a divisional game in Green Bay, its first postseason visit there since a heartbreaking loss to the Packers in the Ice Bowl in 1967.

"You just have to stay in the moment and understand the game," Romo said. "It doesn't end after the first quarter, second quarter. You just have to keep calm. I've played enough games to understand that. Maybe I didn't do that as well when I was younger."

The Lions (11-6) went 99 yards for one of two first-quarter touchdowns, but Matthew Stafford couldn't get them in the end zone again.

Detroit was driving with a 20-17 lead midway through the fourth quarter when referee Pete Morelli announced a pass interference penalty against Anthony Hitchens on a third-down pass to Brandon Pettigrew. But officials reversed the call, and Sam Martin followed with a 10-yard punt.

Pettigrew said he didn't get an explanation, while Lions coach Jim Caldwell said he did — but didn't like it.

"Not a good enough one. I'm going to leave it at that," Caldwell said. "I'm not going to sit up here and act like that was the play that made a difference in the game. We still had our chances."

Morelli said the back judge threw a flag. But the head linesman said there wasn't enough contact and that Hitchens was face-guarding, which isn't a penalty in the NFL. Morelli acknowledged he should have waited longer to announce the penalty. He also announced that there was no penalty, but never explained why the flag was picked up.

Said Morelli, "It probably would have been smoother if we got together."

Romo took the Cowboys 59 yards in 11 plays, including a 21-yard pass to tight end Jason Witten on fourth-and-6. His winner to Williams was an 8-yard pass with 2:32 left.

The Cowboys had to wait a little longer to celebrate. Rookie DeMarcus Lawrence gave the Lions the ball back with a fumble following Anthony Spencer's sack that knocked the ball loose from Stafford, who was 28-for-42 for 323 yards against his hometown team.

Lawrence redeemed himself on the clincher, sacking Stafford on fourth down near midfield in the final minute.

Detroit has not won a playoff game since the 1991 season.

"I'm speechless. ... I didn't expect this outcome," said defensive tackle Ndamukong Suh, who was later asked if the game had been stolen from the Lions.

"It's unfortunate for sure," he said. "We can't let just one play define the game."