It all came down to one final kick. With the Washington Football Team trailing by two with five seconds left Thursday night, kicker Dustin Hopkins swung his leg, the ball spiraled toward the uprights and sailed wide right, sending New York Giants players and coaches — as well as some fans scattered behind their bench — into a frenzy. It took them a moment before they noticed the yellow flag on the ground near the Washington sideline.

Giants defensive lineman Dexter Lawrence had jumped offside on the field goal attempt, and the mistake gave Hopkins another chance. He put his second kick, this time from 43 yards, through the uprights, giving Washington a 30-29 victory and sending the Giants home from FedEx Field with a heart-wrenching defeat.

“The biggest thing for [Lawrence] is, it’s going to be a tough lesson,” Giants Coach Joe Judge said. “It’s a lesson you got to learn, a lesson we all have to learn as a team so we don’t repeat the mistakes, one by one. You got to see that and make sure we clean it up.”

Judge made it clear after the game that he would not pin the loss on Lawrence, saying the entire team had to play better and that one player was not solely responsible.

“You see the margin of error with the score. It’s a tight game — there’s a lot of little things that add up over time,” Judge said.

Lawrence’s penalty was one of a few costly errors that the Giants committed late in Thursday’s NFC East matchup.

The first critical mistake came late in the fourth quarter with 6:25 remaining and the Giants up three. A blown coverage by Washington’s secondary left New York’s Darius Slayton wide open for a potential touchdown catch. Quarterback Daniel Jones found Slayton 40 yards downfield, but the pass tipped off the wide receiver’s fingers.

Later, on Washington’s winning drive, Giants linebacker Lorenzo Carter had a neutral zone infraction that stopped the clock and advanced the ball past midfield.

“It comes down to the small details, and obviously we didn’t get those done today,” Giants wide receiver Sterling Shepard said. “And it’s something we have to go to the drawing board and get corrected.”

Both teams made numerous mistakes Thursday; they combined for 20 penalties for 161 yards. Taylor Heinicke threw an interception deep in Washington territory when his team had the lead, giving the ball back to the Giants and allowing them to kick a go-ahead field goal. But ultimately, Washington was able to take advantage of the Giants’ mistakes when it counted.

“We’re very fortunate to pull this one out,” Coach Ron Rivera said. “... They made some plays. They put themselves in a position to win as well. The unfortunate part of this game is that somebody’s got to lose.”