The Office of Special Counsel (OSC) determined that Housing and Urban Development (HUD) Secretary Julian Castro broke the law when he campaigned on behalf of Hillary Clinton.

The violation took place last April, during an interview with Yahoo News, which was broadcast from the department’s recording studio, with the HUD seal in the background. During the recording, Castro praised the former Secretary of State, claiming: “Hillary Clinton is the most experienced, thoughtful and prepared candidate for president that we have this year.”

Although Castro prefaced his remarks by saying he was “taking off my HUD hat for a second,” the OSC deemed the remarks in violation of the Hatch Act, which prohibits federal employees from using “official authority or influence to interfere” with the results of an election. The President and Vice President and their staff are exempt from the regulation.

“Secretary Castro’s statements impermissibly mixed his personal political views with official government agency business,” the OSC concluded in its report.

The office noted that Castro had been briefed four times on the Hatch Act since he began his appointment in July 2014.

“The ethics officials testified that, based on the information Secretary Castro was given, they believe that he should have known that he could not switch from speaking in his official capacity to speaking in his personal capacity at an event or during an interview,” the report went on.

Castro has long been considered as a potential running mate for Hillary Clinton, who herself was recently the subject of an FBI probe into official misconduct–the mishandling of government secrets as Secretary of State. The bureau determined earlier this month that although Clinton and her team acted “extremely careless,” they did not intend to break the law by maintaining a private email system. No charges were recommended.

In response to the OSC’s findings late last week, Castro admitted wrongdoing.

“My aim was to make clear to anyone viewing the broadcast that, when answering those direct questions regarding candidates, I was not acting in my official capacity,” he told investigators.

“When an error is made — even an inadvertent one — the error should be acknowledged,” Castro added. “I now understand that the mixed-topic interview, even with a proviso, is problematic.”

The OSC’s findings were relayed to President Obama who will make any final determinations regarding punishment.

The Hill noted, however, “because Castro acknowledged the mistake, no additional action is expected.”

OSC is an independent investigative agency charged with overseeing federal workforce practices.