Ben Carson. Joshua Roberts/Reuters

Just one sentence may have caused Housing and Urban Development Secretary Ben Carson to violate an ethics law at President Donald Trump's Tuesday-night rally in Phoenix.

As Carson was set to take the stage at the rally, an announcer introduced him with, "the secretary of the US Department of Housing and Urban Development, Dr. Ben Carson."

That's all it took for a possible Hatch Act violation.

The 1939 law prevents government employees — such as cabinet secretaries— from using their position to advance or promote any political party or candidate. Its purpose is to ensure "federal programs are administered in a nonpartisan fashion, to protect federal employees from political coercion in the workplace, and to ensure that federal employees are advanced based on merit and not based on political affiliation​," according to the Office of Special Counsel's website.

While Carson did not address his current job while speaking at the rally, his introduction may have been enough to trigger a violation. Carson was presented at the event in his official role and did not clarify that he was speaking in an unofficial capacity. Compounding the incident is the fact that Trump, though he is more than three years away from a possible reelection, has already declared his 2020 candidacy. The Tuesday rally was billed as a campaign event.

Responding to a Washington Post report on the episode, a Housing and Urban Development spokesman said the department did not "believe there was a Hatch Act violation."

The spokesman said Carson "did not hear his name before he was cued to go on."

"Dr. Carson’s travel and lodging were not paid for by the Department," HUD spokesman Raffi Williams said in an email to The Post. "Dr. Carson was there in his personal capacity. Additionally, he did not discuss HUD during his speech. We are unaware of what instructions, if any, were provided to the announcer. All other references during the event refer to him as Dr. Carson. In this instance he did not hear his name before he was cued to go on. We are consulting with our ethics office on the matter to ensure it doesn't occur again."

Ian Bassin, an associate White House counsel under President Barack Obama whose portfolio included Hatch Act compliance, said the incident was an unequivocal violation.

"The Hatch Act is complex, but some parts are simple: if you're at a campaign rally, you can't use your title," he tweeted.

But when asked by a fellow Twitter user about how enforcement of the Hatch Act worked, Bassin said, "Not well."

"OSC investigates and then makes findings and sends them to POTUS who then decides whether to impose penalty," he tweeted.

Carson wouldn't be the first administration official to be found in violation of the Hatch Act. In early June, the Office of Special Counsel issued a warning to White House social-media director Dan Scavino for having in April advocated on Twitter the electoral defeat of Republican Rep. Justin Amash of Michigan.