Back in the late 1970s and early ’80s, the Metropolitan Museum of Art, arguably New York’s most esteemed institution, kept its treasured works about as secure as the razor blades at Duane Reade.

“Before surveillance, which became sophisticated in 2004, museums were vulnerable,” John Barelli, the Met’s chief security officer until 2016, told The Post. “They want the public to have access to the art, and that results in the work being exposed. Sometimes it bites you in the ass.”

He explains just how easy it once was to rob the Met in his new book, “Stealing the Show” (Lyons Press).

In 1979, one year after Barelli, now 70, started, the heralded “Treasures of Tutankhamun” exhibit was in full swing. It was so popular, the Met extended its hours to accommodate crowds.

Amid all that hubbub, it was not too difficult for someone to walk out with a 23-pound marble sculpture of Greek god Hermes. The $150,000 head, dating to the fifth century and with a heart carved above one eye, was simply yanked from the wooden pedestal on which it had rested for decades.

A search of the museum and patrons provided no clues, Borelli recalled.

“Five days later,” he said, “somebody called Rocke­feller Center security and said, ‘If you are looking for the head, it is in locker 5514 at Grand Central Station.’ ”

The head was there and in good shape, save for one alteration: A second heart carved above the right eye, which contributed to a ­hypothesis.

“One theory is that it was given as a Valentine’s Day gift,” Borelli said. “Then the recipient heard [on the news] about the head being stolen, and said, ‘What the frig?’ and wanted to return it.”

A year after that, two teenagers used a wire coat-hanger to bump a 3,000-year-old Ramesses VI gold ring off a pedestal and spirit it away. The theft wasn’t even noticed until they sold the $50,000 piece for $5,000 to a jeweler on Lexington Avenue for $5,000 — who then called the Met and offered to return it for a reward.

“He wanted to sell it back to us for $80,000 and was [talked] down to $25,000,” said Barelli. “We agreed to meet him at Acquavella Galleries [on East 79th Street]. But the jeweler sent an associate. The deal was made, the associate was arrested — and he turned in his boss who was waiting outside.”

As for the larcenous teens, Barelli recalled, “The judge said he would reduce [probation] if the kids enlisted in the Marines. That was the last we heard of them.”

(The Met did not return requests for comment on anything in this story.)

By 1981, stealing from the Met must have looked so easy that an employee decided to give it a go — nabbing two Celtic coins and five pieces of early Christian jewelry, valued at $150,000 to $200,000. That heist was noticed and ­reported by a custodian, Charlie Kelly.

Security traced the pieces to a dealer in Deer Park, Long Island, where the coins were about to be sent to London for auction.

Asked who had brought them in, the dealer looked at his ledger and said, “Charlie Kelly” — the theft-reporting custodian.

“It’s a sad case,” said Barelli of Kelly, who got probation. “He was getting divorced and needed the money.”

After the confession, Barelli asked Kelly why he gave his real name to the dealer. “Mr. Barelli,” said the custodian, “it’s the law.”