The Department of Housing and Urban Development (HUD) said Thursday that Ben Carson Benjamin (Ben) Solomon CarsonBiden cannot keep letting Trump set the agenda The Hill's 12:30 Report: Trump heads to New Hampshire after renomination speech Five takeaways on GOP's norm-breaking convention MORE, the agency's secretary, did nothing wrong in appearing alongside President Trump at a campaign-style rally in Phoenix, Ariz.

"His travel and lodging were not paid for by the department. He was there in his personal capacity. He didn't discuss HUD during the speech," Jerry Brown, a spokesman for the agency, told ABC News.

Carson has faced questions since Tuesday's rally about whether his appearance violated the Hatch Act, a law prohibiting executive branch employees from using their positions for political causes.

ADVERTISEMENT

That law, however, doesn't bar such employees from appearing at campaign events in a personal capacity, according to one legal expert who spoke to ABC News.

Some critics have pointed to the fact that Carson was introduced by his official title when he delivered opening remarks at the rally.

Brown told ABC News it was the Trump campaign — not the government — that paid for Carson's expenses on the trip.

Carson isn't the first Trump official to face accusations of violating the Hatch Act. White House social media director Dan Scavino was reprimanded by the Office of Special Counsel in June for breaking the law after he tweeted a call for Rep. Justin Amash Justin AmashOn The Trail: How Nancy Pelosi could improbably become president History is on Edward Snowden's side: Now it's time to give him a full pardon Trump says he's considering Snowden pardon MORE (R-Mich.) to be defeated in his 2018 primary.