In “Bonnie and Clyde,” the 1967 hit film staring Warren Beatty and Faye Dunaway as the murderous lovers who captivated the country during the 1930s, the Texas Ranger who pursues them is Frank Hamer, a bumbling idiot.

Bonnie (Parker) and Clyde (Barrow) kidnap Hamer, tie him up, and then take pre-selfie era photos with him as if he’s some sort of trophy. Bonnie rests her hand on his chest. Clyde smiles.

The film, of course, is an American classic. In 1992, it was added to the National Film Registry at the Library of Congress — a list that also includes “Citizen Kane and “Gone with the Wind.”

But when Hamer’s widow saw the film, she was moved not emotionally or cinematically but legally. Hamer was never kidnapped. And he certainly was no idiot.

She sued Warner Bros. for defamation and settled out of court, resurrecting her husband’s legacy as one of the most fearsome lawmen in history — the man who hunted down Bonnie and Clyde, ending a crime spree that grotesquely transformed the amorous bandits into national heroes.

Now, in the new Netflix film “The Highwaymen,” Hamer’s role is resurrected on screen. It’s the first time the story has been told from the law enforcement point of view — a mission screenwriter John Fusco took upon himself almost two decades ago when he learned of Hamer’s real role.

“Not taking anything away from the brilliance of that movie, which we filmmakers recognize as a watershed moment in cinema history and cultural touchstone,” Fusco said in an interview. “But that portrayal of Frank Hamer was just so far off the mark. And the more I researched about him, the more I realized that he was really a true unsung hero and a quiet man who didn’t want any press and had a job to do that he didn’t want to do.”

In other words, a Texan.

Hamer is played by Kevin Costner in “The Highwaymen.” Woody Harrelson plays his partner, Maney Gault. While the film dramatizes some of the hunt for cinematic effect, Fusco and director John Lee Hancock said they tried to hew closely to accounts by journalists, historians and, in the case of Hamer, recollections from his descendants.

The film, a classic chase story, reveals biographical tidbits about Hamer via dialogue between Costner’s and Harrelson’s characters. These are not men of many words, but what they do say is tough and definitely Texan. Also, they pretty much always wear suit and tie.

Harrelson (Gault): “How many bullets you got in you?”

Costner (Hamer): “Hell, I don’t know."

He does the math for a moment. Then says, “Sixteen, I think."

Hamer got his start in Texas law enforcement in the early 1900s on a horse. In his time as a Texas Ranger, Hamer was in dozens of gunfights and killed at least 53 people. That number is not a typo. Today, most police officers go their entire careers without ever firing their weapons in the line of duty.

“He was ready always to bring things to a fatal conclusion,” said Jeff Guinn, the author of “Go Down Together: The True, Untold Story of Bonnie and Clyde.” “When he was a captain with the Rangers, he used to tell his troops the best way to enforce the law is with a slug in the gut. And he didn’t mean a punch.”

But back in Hamer’s day, justice wasn’t blind. He and the Rangers had a brutal record when it came to anyone not white — especially along the border during the Mexican Revolution.

Guinn said the Rangers were “not only lethal, they were relatively unchecked.” To keep the peace — peace as they saw it — nothing was off the table, Guinn said, even “coldblooded murder.”

But Hamer was also capable of protecting those whom no one else wanted to protect.

“Hamer and three of his Rangers held off a mob of 6,000 intent on lynching a black man who had raped a white woman,” wrote John Boessenecker, the author of a biography of Hamer. “When the rioters burned down their own courthouse in order to kill the prisoner locked up inside, Frank Hamer became the first and only Texas Ranger to lose a prisoner to a lynch mob. He and his men barely escaped the raging inferno alive.”

For all his toughness, though, it was his wits that led him to Bonnie and Clyde. Hamer spent weeks driving around Texas, Louisiana and other nearby states trying to find the couple. Plotting their crimes on a map, he noticed they just kept moving in a large circle.

“An officer must know the mental habits of the outlaw,” Hamer told a historian in the 1930s, “how he thinks, and how he will react in different situations.” It wasn’t enough for Hamer to track them using mug shots. To catch the bandits, he had to think like the bandits.

Hamer became obsessed — as the movie shows — with “even the smallest details concerning Clyde Barrow and Bonnie Parker,” Guinn wrote in his book. “What kind of clothes did they wear? What brand of cigarettes did each smoke?” Hamer even lived out of his V8 Ford the same way Bonnie and Clyde did.

In coming to know their desperation and their evilness, Hamer knew Bonnie and Clyde weren’t likely to surrender. That meant he’d have to do something he’d never done: shoot a woman. He chewed on that awhile, as do Hamer and Gault in the movie.

The rest of the story is known well enough to say, without being a spoiler, that Hamer and his ambush team were able to get over that trigger hump. They had business to do.

In the movie, the night before the ambush, Hamer puts on a black suit, a black hat, and sits on the porch of a cabin rocking back and forth, back and forth. Inside the cabin, his killing squad plays poker.

Whether this scene actually happened is beside the point. The point is what the film — based closely in reality — does with the rocking.

“What’s he doing out there?” one lawman says.

Hamer is sitting near an open window. The drapes blow back and forth. He can hear everything.

Gault says, “He likes to be alone sometimes."

Hamer puffs on a cigarette.

A lawman inquires about how many men Hamer has killed. More than 50?

Gault indicates more — many more.

The other lawmen listen as Gault tells a story about one particularly violent night.

When he’s finished, the lawmen appear spooked. They look down at their cards.

Hamer rocks back and forth, back and forth.

Read more Retropolis: