The Detroit Lions needed a 59-yard game-winning field goal from Matt Prater to beat the Washington Football Team on Sunday in a wild game.

Detroit let Washington back into the game in the second half after going up 24-3 with 7:58 left to play in the third quarter. Washington scored 21 straight points to tie the game in the fourth.

LIONS' MATTHEW STAFFORD ON BIGGEST STRUGGLES THIS SEASON: 'UM, ALL OF IT'

Prater would give the Lions a three-point lead with 2:37 left in the game. Then, Washington tied the game and thought they had forced overtime with a Dustin Hopkins 41-yard field goal to tie the game with 16 seconds left.

With 12 seconds left, Washington rookie Chase Young was flagged for a roughing the passer penalty on Matthew Stafford allowing the Lions to get closer. After a 9-yard pass to Marvin Jones, the Lions were able to set up Prater for the winner.

ALEX SMITH STARTING FIRST NFL GAME SINCE SUFFERING GRUESOME LEG INJURY

Stafford finished with three touchdown passes and 276 passing yards. D’Andre Swift got his first career start for the Lions and rushed for 81 yards and had five catches for 68 yards and a touchdown.

Alex Smith started his first game since a gruesome leg injury nearly cost him his life.

He had one of the best games of his career. He finished with 390 passing yards but failed to throw a touchdown pass. Antonio Gibson and J.D. McKissic had touchdowns on the ground. Gibson scored twice.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

The Lions moved to 4-5 with the win. Washington fell to 2-7.