Green Bay’s Donald Driver, left, makes a touchdown catch next to New York’s Corey Webster in the fourth quarter of Green Bay’s 38-35 victory. (GARY HERSHORN/Reuters)

The Green Bay Packers took another step toward perfection and officially secured their spot in the NFC’s playoff field. Quarterback Aaron Rodgers threw four touchdown passes and then took the Packers down the field when it mattered the most as they beat the New York Giants, 38-35, on Sunday at MetLife Stadium.

Place kicker Mason Crosby’s 30-yard field goal as time expired won it for the Packers after the Giants had tied the score in the final minute.

“Just a classic two-minute drive,” Packers Coach Mike McCarthy said. “I thought it was awesome.”

The Packers improved their record to 12-0. They won their 18th straight game, counting last season’s run through the postseason to their Super Bowl triumph, and they clinched a playoff berth. They later clinched the NFC North title with the Detroit Lions’ loss Sunday night at New Orleans.

“Those are the fun ones, when you end up like that,” Rodgers said.

The Giants got even with 58 seconds remaining on quarterback Eli Manning’s two-yard touchdown pass to wide receiver Hakeem Nicks and a two-point conversion run by tailback D.J. Ware. But Rodgers quickly moved the Packers into position for Crosby’s winning kick with four completions, beginning with a 24-yard connection with tight end Jermichael Finley.

“I think the first play was the most important play,” Rodgers said. “Obviously that kind of determines the drive.”

Rodgers threw an interception in a 28-for-46, 369-yard passing performance. But he had two touchdown passes to wide receiver Donald Driver and one each to Finley and wideout Greg Jennings. That brought Rodgers’s totals for the season to 37 touchdown passes and five interceptions.

“I’m running out of things to say about him,” McCarthy said. “He’s a great quarterback.”

Linebacker Clay Matthews had a touchdown for the Packers on an interception return.

Manning threw three touchdown passes and tailback Brandon Jacobs ran for a touchdown for the Giants. But they lost their fourth consecutive game, dropping their record to 6-6. They remained a game behind the first-place Dallas Cowboys in the NFC East.

“I’m sick to my stomach, to be honest with you,” Giants defensive end Justin Tuck said. “A win takes all of that away. But until we get that win, that feeling is going to stick with you.”

The Giants were coming off a 49-24 defeat Monday night at New Orleans, and their losing streak had knocked them from first place in the NFC East. But they knew a thing or two about ending an undefeated season. The Giants beat the New England Patriots in the Super Bowl to end the 2007 season after the Patriots had gone 18-0 in the regular season and the AFC playoffs. Those Patriots beat the Giants at the Meadowlands in a memorable regular season finale to become the first NFL team to go unbeaten in a 16-game regular season.

Manning gave the Giants the early lead Sunday when he lofted a deep pass that fell into the arms of Travis Beckum on the third play of the game. The third-year tight end began the day with only one catch for two yards this season. But he grabbed that pass from Manning and weaved his way around Packers defenders to reach the end zone for a 67-yard touchdown.

The Packers got even with the sort of precise passing that Rodgers has had on display all season. He connected with wide receiver Jordy Nelson for a 33-yard gain and teamed with Jennings for an 18-yard completion. That set up a 12-yard touchdown pass to Finley. Rodgers ran to his right on the play and zipped an on-target throw to Finley at the goal line.

Manning’s 42-yard completion to wide receiver Victor Cruz set up a 38-yard field goal by Lawrence Tynes. The Giants got the ball back, but Manning made a mistake on the first play of the second quarter, sending a pass toward tailback Ahmad Bradshaw that was intercepted by Matthews and returned 38 yards along the sideline for a touchdown. Rodgers returned the favor, throwing an interception to Giants linebacker Chase Blackburn to set up Jacobs’s one-yard touchdown.

But Rodgers and the Packers responded with a 13-yard touchdown catch by Driver, who had no Giants defender near him as he stood in the end zone. The Packers recovered a fumble by Manning caused by Matthews on a sack, but Crosby missed a field goal as time expired in the first half.

The Packers shrugged that off and scored on their first possession of the third quarter, with Rodgers throwing a 20-yard touchdown pass to Jennings. Giants cornerback Prince Amukamara knocked the ball from Jennings’s grasp at the end of the play, but the officials ruled on an instant-replay review that Jennings had the ball long enough to be awarded the touchdown. It was Manning’s turn, and he threw a four-yard touchdown pass to Nicks on a fade pattern to make the score 28-24. Tynes’s second field goal of the day, a 50-yarder, made it a 28-27 game early in the fourth quarter.

Driver’s second touchdown catch came on a seven-yard pass by Rodgers with just more than 31 / 2 minutes to play.