Play video content Exclusive Details TMZSports.com

NASCAR legend Tony Stewart straight-up socked a heckler in the jaw at a racetrack Friday night ... and the entire incident was caught on camera.

48-year-old Stewart -- a 3-time NASCAR Cup Series champ -- was driving in a sprint car race in Jackson, Minnesota when he claims his engine blew out on him after just one lap.

A ton of fans flocked to the track to see the race star drive that night -- the Jackson Motorplex even advertised it as "Tony Stewart Night" -- so Tony stuck around afterward to sign some autographs.

That's when a heckler came up to Stewart -- and according to one eye witness, Brandon Woehl -- began cussing out Smoke for "quitting" only one lap into the race.

"F*ck you, Tony," the heckler allegedly said ... "You piece of sh*t. You come here and basically race for one lap and quit, you piece of sh*t."

That's when Woehl says Tony responded, firing back, "I blew my engine, you f*cking asshole. Do you want to pay for it?"

The two traded a few more barbs ... with Stewart deciding to unleash a single-barrel salute to the heckler with his left hand.

In the video, you can hear the heckler's response, because he screams back at Stewart, "Hey, Tony, I got two of them" while flipping him off with BOTH hands.

Stewart immediately lost his cool and went after the guy ... and in the video, you can hear Tony's left fist collide with the heckler's face!!!

Woehl claims Tony said after the punch, "F*ck, I broke my hand."

Woehl also says members of Tony's camp took him away from scene almost immediately after the incident ... while the heckler was ushered away by event security.

Cops tell TMZ Sports they were NOT called to the scene ... and, instead, they say the matter was handled internally by race track officials. They say no formal complaints against the driver have been filed.

We've reached out to Tony's camp multiple times, but so far, no official comment.

Stewart -- who retired from NASCAR following the 2016 season -- now spends a ton of time racing in small events throughout the country. He's also the co-owner of Stewart-Haas Racing.