Entertainment

Battle won!

J.R. Martinez and Karina Smirnoff pose with the mirror ball trophy after their win. (Reuters)

Wounded war vet and soap star J.R. Martinez squeaked out a narrow victory last night to win “Dancing with the Stars.”

The 28-year-old actor, who’d been burned over nearly half his body by a roadside bomb in Iraq, was an inspirational story that couldn’t be beat.

But in the end, it was his dancing that won him the funny, mirror-ball trophy.

PHOTOS: ‘DANCING WITH THE STARS’

MORE: WHO IS J.R. MARTINEZ?

Only a handful of soap-opera hardheads had ever heard of Martinez, 28, who was cast on “All My Children” in 2008 to play a character exactly like himself, a wounded Iraq war veteran.

But even before last night’s finals, his big personality and infectious energy made him the show’s most popular celeb of this season.

Martinez beat Rob Kardashian, younger brother of the reality-TV sisters, and the biggest surprise of the season.

Kardashian began three months ago, out-of-work, out-of-step, the hanger-on Kardashian sibling no one could quite place.

By last night, he was the consensus winner for most-improved competitor, and ended up within a hair’s breadth of taking the whole contest.

Even sister Kim, who had not made a public appearance in the United States since filing for divorce earlier this month, had to show up last night — looking suitably grim — when Rob danced for the top prize.

Talk-show host Ricki Lake, the early favorite, came in third.

In the end, it was not the most memorable year for TV’s second-highest-rated show (behind “American Idol”) because hardly anyone in the cast stood out early on.

“Dancing with the Stars’ ” affable host, Tom Bergeron, even said publicly that it might be time to cut back to one show a year — instead of the two, in fall and spring, that have aired since the program began six years ago.

Chaz Bono, Cher’s press-shy transsexual son, drew a lot of attention early — from everyone from family groups who objected to his being on the show, to the merely curious who tuned in to see what the fuss was about.

But Chaz proved to have two left feet and was never a real contender.

Snarling cable news anchor Nancy Grace showed a sweet side that few knew she had — and was rewarded with enough fan support to stay on the show all the way through the semifinals.

In fact, it was a progressional dancer, the fiery tempered Maks Chmerkovskiy, who got most of the headlines this year, clashing with the judges when they criticized him and his partner, the Olympic soccer goalie Hope Solo.

After threatening not to return for the finale, he was in the front row last night, and danced a fancy quick step as he tried to show the judges in the theater that they’d been wrong.