In 2016, then-Secretary of Housing and Urban Development Julián Castro violated a federal law while campaigning for Hillary Clinton, but the Obama administration chose not to fine or reprimand him. Instead, they praised him for “own[ing] up” to his “inadvertent error.”

Castro himself is now running for president. Aside from his short stint leading the federal housing agency, Castro served as mayor of San Antonio, Texas, from 2009 to 2014; before that, he worked as an attorney. Yet despite his legal background, his Harvard Law School education, and his having attended four federal briefings on how to comply with the Hatch Act — the federal law passed in 1939 that bars most employees in the executive branch from using their official authority or influence to shape an election — Castro claimed in 2016 that he was unaware of his error.

The U.S. Office of Special Counsel launched an investigation following a complaint filed against Castro on April 11, 2016, and ultimately concluded that he had violated the ethics law.

One week earlier, Castro did an 18-minute interview with Katie Couric on Yahoo News. According to the special counsel investigation, Yahoo News requested the interview in February 2016 and indicated that it wanted to focus on both Castro’s work for the Department of Housing and Urban Development and his role as a surrogate for the Clinton campaign. The details were arranged by HUD’s Office of Public Affairs, and three days before the interview, Castro received a briefing memo from his agency’s press shop outlining that potential questions could pertain to his work at HUD, the growth of cities, and his time as a Clinton supporter during her campaign.

At the time, the primary contest between Clinton and Vermont Sen. Bernie Sanders was still going on. Clinton had swept five key states on March 15 and appeared to be pulling away from Sanders, but New York had yet to vote, and the insurgent campaign was hoping for an April upset there (that didn’t materialize).

In 2012, Castro delivered the keynote speech at the Democratic National Convention, and from then on, he was routinely referred to by journalists and political observers as a “rising Democratic Party star.” In 2016, Castro was reportedly being vetted by the Clinton campaign as a potential running mate; he had endorsed her for president in October 2015.

The Yahoo News interview was conducted remotely, with Castro sitting in HUD’s broadcast studio in Washington, D.C. The official HUD seal was displayed behind Castro. After about seven minutes of discussing HUD initiatives, he was then asked about his endorsement of Clinton. “Now, taking off my HUD hat for a second and just speaking individually, it is very clear that Hillary Clinton is the most experienced, thoughtful, and prepared candidate for president that we have this year,” he said.

Castro then went on to describe Clinton’s record as secretary of state and touted her ability to excite the electorate, including Hispanic and black voters. “In the end, the American people understand she has a positive vision for the country that includes opportunity for everybody, and she can actually get it done,” he said.

Despite receiving the briefing memo saying he could expect questions on his time as a Clinton supporter, Castro claimed later, according to the special counsel investigation, that he “expected that Ms. Couric’s questions would focus primarily on HUD’s activities and the growth of cities.”

Castro said he believed at the time that he was complying with the Hatch Act, though he “now understand[s]” that an interview like that “is problematic.” Castro joined the Obama administration in 2014, and prior to his violation, according to the special counsel’s office, he had attended four briefings on the Hatch Act in which he was advised by federal ethics officials on how to properly comply with the law. Castro’s most recent briefing before the violation was in February 2016.

At the briefings, according to the Office of Special Counsel’s report, Castro was told by ethics advisers that if he is speaking in his official capacity about HUD matters and is asked a political question, then he should respond by saying that he is not there to talk about politics. Relatedly, he was advised that if he speaks at a political event in his personal capacity, then he should not talk about HUD or use the title “secretary.” At one of the briefings, Castro reportedly asked an ethics adviser what to do if a journalist asks him about HUD while he’s at a political event; he was told that he should tell the journalist that since he’s at a political event in his personal capacity, he cannot answer questions about HUD.