Charles Whitman, left, in 1966 before he killed 17 people at the University of Texas in Austin, and Stephen Paddock, right, in an undated family photo, who mimicked Whitman’s technique of shooting down into a crowd. (AP)

The hail of bullets that rained down from the Mandalay Bay Resort and Casino in Las Vegas on Sunday night — killing at least 58 and wounding more than 500 — eerily echoes the dawn of mass shootings in America.

In 1966, on a hot Texas summer afternoon, ex-Marine sharpshooter Charles Whitman, 25, boarded an elevator in the University of Texas Tower with a cache of weapons, intent on deadly mayhem.

From more than 300 feet above, Whitman blasted victims on campus and nearby — a pregnant woman, shot in the belly; her boyfriend, shot in the neck; a teenager, shot in the face. Seventeen people died that day, and more than 30 were wounded.

Like the dozens of victims shot by Stephen Paddock from the 32nd floor of the Mandalay Bay resort, Whitman’s targets were confused, defenseless and easy targets for at least 20 minutes as police scrambled to find where the shots were coming from.

This week former FBI profiler Mary Ellen O’Toole said the similarities between Paddock and Whitman are striking. O’Toole, now the director of the Forensics Science Department at George Mason University, told a WUSA reporter that she believes Paddock likely researched the Texas shooting. He would have been 13 when it happened. Like Whitman, he carried his weapons to a high perch and positioned them to achieve maximum carnage.

“Frankly, I’m surprised it took this long to have one so similar,” O’Toole said.

In Texas, locals raced him to get their own guns and shoot back, helping to pin Whitman down and slow his shots. Police then made their way up the Tower and killed him.

“These guys were pretty good shots,” said Bill Helmer, then a graduate student who witnessed the mayhem. “There was a lot of lead flying up there at him.”

When the shooting started, nobody could quite figure out where the shots were coming from. Professors began calling the police. The tapes of those calls are chilling.

“Hello, this is Michael Hall at the history department on the university campus,” one said.

“Yes, sir,” the police operator said.

“There’s just been a gunshot on the main plaza outside the main building, and at least one person wounded.”

“We’ll have an officer come by right away,” the operator said.

None Smoke rises from Charles Whitman’s gun on Aug. 1, 1966, as he fires on crowds below from the Tower of the University of Texas administration building in Austin. (AP)

Then, as victims were splayed on the ground near the Tower, the shooter’s location became apparent.

“Hi, this is the Department of English at the university,” the caller said. “Someone is shooting from the Tower. Can you send someone right away?”

Neal Spelce, then a 30-year-old reporter at KTBC in Austin, raced to campus in his station’s mobile broadcasting vehicle — a red station wagon called Red Rover.

He parked Red Rover about 200 yards from the Tower. Shots whizzed over his head as he reported live.

“It’s like a battle scene,” he said on the air. “There’s a shot, and another shot, and another shot.”

Whitman’s rampage lasted 96 minutes, until brave officers shot and killed him on the Tower’s deck.

“The sniper,” Spelce reported, “is dead.”

Former KTBC reporter Neal Spelce covered live on television the sniper shooting on the University of Texas at Austin campus on August 1, 1966. Spelce takes The Post up the clock tower where Charles Whitman carried out his rampage. (Claritza Jimenez,Mike Rosenwald/The Washington Post)

Though the victims were honored on campus last year on the 50th anniversary of the shooting, Whitman’s attack had been mostly forgotten as mass shootings became a scourge on the country. But the legacy of the shooting is profound.

SWAT teams were created after the attack. A national discussion began about the role of mental illness in mass killers. And the pace of such events picked up.

Grant Duwe, a criminologist and author of “Mass Murder in the United States,” said that in the 50 years before Whitman’s attack, there were 25 mass public shootings, defined as the killing of four or more people in a public place without a connection to drug deals, gang disputes or other underlying criminal motive.

After: more than 150 and counting.

“The UT-Austin shooting was the bellwether for the unprecedented rise in mass public shootings in the last half-century,” Duwe said.

The tally now includes Las Vegas, where Paddock, 64, killed at least 58 people and injured more than 500. It just became the deadliest mass shooting in modern U.S. history.

This post has been updated.

Read more Retropolis:

Virginia Tech was not the worst school massacre in U.S. history. This was.

O.J.’s last defender — F. Lee Bailey — is broke, disbarred and working above a hair salon

Hugh Hefner, the murder of Dorothy Stratten and the dark side of Playboy

JFK’s last birthday: Gifts, champagne and wandering hands on the presidential yacht

Blood in the water: Four dead, a coast terrified and the birth of modern shark mania

Mail that baby: A brief history of kids sent through the U.S. Postal Service

How a despondent veteran helped make the Golden Gate Bridge a suicide destination 

Six Nazi spies were executed in D.C. White supremacists gave them a memorial — on federal land.