A U.S. Secret Service agent keeps watch as US President Barack Obama walks back to the Oval Office after a ceremony on the South Lawn at the White House in Washington, D.C. on April 1, 2014. (AFP/Jewel Samad)

Top officials at the Secret Service ordered agents charged with guarding the White House to abandon their posts in 2011 so they could instead be redirected to protect a personal friend of the agency's director, three people familiar with the operation told the Washington Post.

Known internally as "Operation Moonlight," the assignment diverted agents for at least two months to a location in Maryland about an hour away from Washington, D.C. to protect then-director Mark Sullivan's personal assistant, the three individuals reportedly said.

A U.S. Secret Service agent keeps watch as US President Barack Obama walks back to the Oval Office after a ceremony on the South Lawn at the White House in Washington, D.C. on April 1, 2014. (AFP/Jewel Samad)

According to people familiar with the internal shift records, two agents were deployed twice a day to Lisa Chopey's home in rural Maryland, beginning June 30, 2011, the Post reported.

Sullivan, who left his job following the agency's prostitution scandal, was worried Chopey was being harassed by her neighbor, the sources told the Post.

Secret Service spokesman Ed Donovan confirmed to the Post that agents were pulled off their White House posts to protect Chopey, but disputed that the assignment lasted more than a few days. The assigned security detail was a standard response to a potential threat against an agency employee, he added.

However, according to the Post, the agents thought their reassignment was a possible illegal use of government resources and were concerned it increased security risks to the president.

The agents reassigned were part of a unit nick-named "Prowler" that is tasked with patrolling the outskirts of the White House compound, the Post reported.

“Prowler is there for a reason, and it shouldn’t be pulled when the president is on the move,” Dan Emmett, a former Secret Service agent, told the Post.