Newly released FBI files reveal more details of the potential vulnerability of the personal e-mail server Hillary Clinton used while serving as secretary of state — and the lax manner in which she and her staff dealt with security issues.

Top aide Huma Abedin expressed shock when she learned that a hacker tried to gain access to Clinton’s server in 2011 — writing “omg” when she was alerted to the attempted intrusion, show the records, which surfaced Tuesday.

But Abedin waited nearly 12 hours after finding out about the cyber attack before warning other key State Department staffers not to e-mail “anything sensitive” to their boss.

A Jan. 9, 2011, e-mail chain shows that Abedin was informed of the incident by Justin Cooper, a longtime aide to former President Bill Clinton who for a time had responsibility for the server in the basement of the Clinton family home in Chappaqua, Westchester.

“I had to shut down the server,” Cooper wrote.

“Someone was trying to hack us and while they did not get in I didn’t want to let them have the chance to. I will restart in the morning.”

At 7:05 p.m, Abedin responded with a three-letter response: “omg.”

But it wasn’t until 6:30 a.m. on Jan. 10, 2011, that Abedin sounded the alarm in an e-mail to Chief of Staff Cheryl Mills and Director of Policy Planning Jacob Sullivan, the records show.

“Don’t email hrc anything sensitive. I can explain more in person,” Abedin wrote.

The records also contain an Aug. 16, 2010, e-mail exchange that shows Clinton confidential assistant Monica Hanley warning Abedin that her personal account may have been hacked.

Hanley told Abedin, “Geri just called — She got a spam email from your [redacted] acct last night.”

“Weird. And my [redacted] isn’t working this morning,” Abedin wrote back.

Hanley responded, “Yeah I wonder if someone hacked in. that stinks.”

About six hours later, Abedin wrote, “I went in and changed password,” the records show.

In 2016, a Post column by Paul Sperry revealed that when the FBI confronted Abedin with those emails in April of that year, Abedin claimed that “she was not sure that her email account had ever been compromised.”

The records also contain five pages of hand-written notes summarizing a March 2, 2016, FBI interview of Cooper, who was previously revealed to have told the feds he twice “destroyed Clinton’s old mobile devices by breaking them in half or hitting them with a hammer.”

The notes of his interview suggest extremely lax security for the secure communication rooms that the State Department created for Clinton in Chappaqua and her other home in Washington, DC.

“Open door — not always secured, sometimes when HRC not @ residence was not closed. (both resid,” the notes say.

“No understanding of when open/closed.”

The notes also say there were safes in each room — called a SCIF, for sensitive compartmented information facility — along with home computers and “no secure computers.”

The emails and interview notes are contained in 277 pages of documents that were quietly added to the FBI’s online “Vault” of public information sometime after Friday, according to the Daily Mail, which first reported their release on Tuesday afternoon.

But a link to the newly posted records had yet to be added to the Vault’s “Hillary R. Clinton” page as of Tuesday evening.

Clinton and her associates came under fire for their email practices by then-FBI Director James Comey in July 2016 when he said they feds uncovered evidence they were “extremely careless in their handling of very sensitive, highly classified information,” but not enough to recommend criminal charges.

President Trump repeatedly seized on those findings during the 2016 presidential campaign against, leading his supporters to chant “Lock her up!”