Winner takes all.

Actor Ben Affleck and “Jeopardy!” champion Jamie Ding won the elusive $1 million prize on “Who Wants to Be a Millionaire.”

On Wednesday night’s episode of the hit game show, the “Gone Girl” star and Ding answered the 15th and final question correctly to take home the grand prize — which will go to Affleck’s foundation, the Eastern Congo Initiative. 

The episode began with the pair having only two questions left to answer.

The $500,000 question read, “What achievement occurred just two months after a New York Times article said it wouldn’t happen for ‘1 million to 10 million years’?”

Ben Affleck and “Jeopardy!” champion Jamie Ding won the rare $1 million prize on “Who Wants to Be a Millionaire.” Disney

The pair had to answer the final question: “In an annual Thanksgiving tradition, all but which of these have been the names of turkeys pardoned by a US president?” Disney

The four answers listed were: the first airplane flight, splitting the atom, cloning a mammal and the polio vaccine. 

Ding initially thought the answer was the first airplane flight and Affleck agreed. 

“I only remember this because it was a time in my life where I spent time looking up examples that the press got things wrong. Yeah, just randomly,” the Oscar winner, 53, said.

“And I sort of, vaguely, in my subconscious remember the Times and the Wright brothers and that whole thing was 1905, 3 or 4, or something,” Affleck added with Ding correcting that it was “03.”

After their Phone-A-Friend ran out of time to give an answer, the actor and Ding listened to host Jimmy Kimmel’s advice and picked Spaghetti and Meatball. Disney

The answer was correct, winning the duo (seen above with Kimmel) $1 million. Disney

Want more celebrity and pop culture news?

Start your day with Page Six Daily.

Thanks for signing up!

Host Jimmy Kimmel quipped that Affleck was “so much smarter” than his close friend Matt Damon, who also won the $1 million prize on “Who Wants to Be a Millionaire” alongside “Jeopardy!” star Ken Jennings last year.

Affleck and Ding then decided to use the 50:50 lifeline to eliminate two answers, leaving them to choose from splitting the atom and the first airplane.

They correctly chose the first airplane and advanced to the million-dollar question, which read, “In an annual Thanksgiving tradition, all but which of these have been the names of turkeys pardoned by a US president?”

The four answers listed were: Peanut Butter & Jelly, Tater & Tot, Mac & Cheese, and Spaghetti & Meatball.

Affleck and Ding (seen above with Kimmel) celebrated as confetti fell everywhere. Disney

The money will go to the actor’s foundation, the Eastern Congo Initiative. Disney

The “Good Will Hunting” actor said, “You must be kidding me,” and suggested they use their Phone-A-Friend lifeline.

When Ding’s friend didn’t answer in time, the pair took Kimmel’s advice and chose Spaghetti and Meatball, winning $1 million.

After choosing the correct answer, Affleck and Ding held each other as they jumped up and down while confetti fell from the ceiling.

“Who Wants to Be a Millionaire” airs Wednesdays on ABC at 8 p.m. ET.