Cardinals running back Andre Ellington (38) celebrates with Jaron Brown after Ellington ran for a 48-yard touchdown in the fourth quarter Sunday against the Seattle Seahawks.

Steve Dykes Getty Images

SEATTLE -- The NFC West goes through Arizona after the Cardinals shoved aside the Seattle Seahawks.

Carson Palmer threw for 363 yards and three touchdowns, Andre Ellington had a 48-yard touchdown run with 1:58 remaining and the Cardinals moved three games ahead in the NFC West with a wild 39-32 victory over the Seahawks on Sunday night.

More from FoxSports

Palmer helped the Cardinals (7-2) build leads of 19-0 and 22-7 at halftime, only to watch Seattle (4-5) rally and take a 29-25 lead early in the fourth quarter on Bobby Wagner's 22-yard fumble return that left CenturyLink Field shaking.

Undaunted by losing the lead, Palmer led the Cardinals on an 83-yard touchdown drive, capped by a 14-yard strike to Jermaine Gresham with 8:41 remaining. The Cardinals held Seattle on its next possession and Ellington added the punctuation, sprinting down the sideline on a third-down run to cap Arizona's big night.

A year ago Arizona was in command of the division at the midpoint of the season, only to crumble down the stretch after Palmer was lost to a season-ending knee injury.

Arizona still has games remaining against Seattle and St. Louis but has a hefty cushion with only seven weeks left in the regular season.

Larry Fitzgerald had 10 catches for 130 yards, his most receptions since Week 14 of 2013, and Michael Floyd had two big touchdown receptions in the first half. The 39 points were the most allowed by Seattle since giving up 40 to San Francisco in Week 14 of the 2010 season.

Russell Wilson was 14 of 32 for 240 yards, one touchdown and one interception, but Seattle committed 14 penalties and couldn't overcome the mistakes of the first half.

The Seahawks got a 46-yard field goal from Steven Hauschka with 58 seconds left to make it a one-possession game, but Fitzgerald recovered the onside kick and Arizona was able to celebrate winning in Seattle for the second time in three years.

After watching Seattle run off 29 of 35 points and committing two costly turnovers deep in their own end, the Cardinals responded with a 10-play, 83-yard drive to retake the lead midway through the fourth quarter. The Cardinals were aided by a huge third-down illegal contact penalty against Bobby Wagner to keep the drive alive and went back in front 32-29 on Palmer's strike to Gresham.

Arizona built leads of 19-0 in the second quarter and 22-7 at halftime, capitalizing on Seattle's inefficiency and mistakes on offense, and hitting big plays against the Seahawks vaunted defense. Floyd had two fantastic touchdown receptions, the first sneaking behind Richard Sherman and tapping his toes for a 27-yard TD and later a 35-yard catch-and-run touchdown, plowing over the pylon to cap a 19-point run in less than 9 minutes.

NFL cheerleaders: Week 10

Seattle responded after halftime, controlling most of the third quarter and got the break it needed on the second play of the fourth quarter. Cliff Avril came unblocked off the edge and sacked Palmer, knocking the ball free. K.J. Wright picked it up and tumbled into the end zone. It was ruled a touchdown on the field, but after review, Wright was ruled down at the 3 after being touched by Palmer.

Marshawn Lynch bulled his way in for his third touchdown of the season on the next play, but Wilson's 2-point conversion pass was incomplete and Seattle trailed 25-23 with 14:44 left.

And almost immediately after the Seahawks were done celebrating Lynch's score, Seattle was in the lead thanks to another sack and fumble on Palmer. This time it was Wright coming unblocked to knock the ball free. Wagner scooped the fumble and returned it 22 yards for his second touchdown of the season and a 29-25 Seattle lead with 13 minutes left.