House and Urban Development Secretary Julian Castro testifies before the House Financial Services Committee on Wednesday, July 13, 2016. (AP Photo/Pablo Martinez Monsivais)

Housing Secretary Julian Castro violated the federal Hatch Act restricting partisan political activity by federal employees when he praised Democratic presidential candidate Hillary Clinton during an interview conducted from his government office, government investigators found Monday.

Castro is among several potential vice-presidential choices for Clinton, who will formally claim the Democratic presidential nomination next week. The telegenic young Cabinet secretary has been mentioned for months as a prospect to be Clinton’s running mate. He was among the first candidates to go through the formal process of vetting by the campaign.

Housing and Urban Development Secretary Julián Castro is on Democratic presidential candidate Hillary Clinton's short list of potential vice presidential candidates. Here's what you need to know about him. (Sarah Parnass,Osman Malik/The Washington Post)

A report from the Office of Special Counsel delivered a mild rebuke to Castro for his handling of the April interview with Yahoo News. The seal of the Housing and Urban Development department was visible behind Castro as he answered questions from host Katie Couric about his support for Clinton, including his chances as running mate. (He said he did not think he would be chosen.)

“In the end, the American people understand that she has a positive vision for the country that includes opportunity for everybody, and she can actually get it done,” Castro said at one point during the interview. He also criticized Republicans.

The report found that Castro did not separate his role as HUD secretary well enough from his role as a Clinton supporter and referred the findings to President Obama. There was no immediate word on whether Obama planned to act on the findings.

“When Ms. Couric interviewed Secretary Castro, she introduced him as ‘secretary,’ the official HUD seal appeared behind him, and he spent the first seven minutes talking exclusively about HUD programs and initiatives. As such, Secretary Castro gave the interview in his official capacity,” the report found.

“Although he stated during the interview that he was ‘taking off my HUD hat for a second and just speaking individually,’ to indicate he was answering questions in his personal capacity, that disclaimer could not negate the fact that he was appearing in his official capacity for the rest of the interview,” the report said.

“Because he advocated for and against presidential candidates while appearing in his official capacity, Secretary Castro violated the Hatch Act’s prohibition against using one’s official authority or influence to interfere with or affect the result of an election.”

Castro took his lumps in the Special Counsel report.

“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. “I now have watched the recording of the interview and appreciate that, while my intention was to avoid any blurring of roles and make clear that I was not speaking as a representative of HUD, that fact may not have been obvious to viewers.”