WASHINGTON — The decision by the Republican National Convention to feature President Donald Trump conducting official business inside the White House underscores how he is leveraging the powers of his office for political gain, raising questions about whether an event featured Tuesday night violated federal law.

In a remarkable pretaped scene packaged as part of the convention's prime-time programming, Trump took part in a naturalization ceremony for five new citizens as acting Homeland Security secretary Chad Wolf administered the Oath of Allegiance.

“On behalf of everyone here today, I’d like to express my gratitude to you, Mr. President, for hosting this naturalization ceremony here at the White House,” Wolf said.

Kathleen Clark, a legal and government ethics professor at Washington University in St. Louis School of Law, said that the event appeared to be designed as part of the convention, an action that would violate a criminal provision of the Hatch Act, which bars executive branch employees from participating in politics in their official capacity.

Under the act, federal employees are prohibited from using their authority to influence the election of a presidential candidate, she said, calling Trump and Wolf “breathtaking in their contempt for the law.”

A White House official, who spoke on the condition of anonymity to describe the legal basis of the event, said it was part of the president’s official schedule that was publicized on a public website.

“The campaign decided to use the publicly available content for campaign purposes,” the official said. “There was no violation of law.”

The most widely known civil provisions of the Hatch Act do not apply to the president and the vice president. But the law applies to executive branch employees who are involved in planning or executing any political events staged at the White House, including video segments filmed there, experts said.

And while the president and vice president are exempt from the civil provisions of the law, they are subject to two criminal provisions derived from the Hatch Act, Clark said.

The naturalization ceremony — as well as a video of Trump granting a pardon inside the White House that aired earlier in the night — comes after numerous Hatch Act violations by administration officials in the past several years.

» READ MORE: ‘Fighting for you’: Melania Trump makes the case for her husband at the RNC

“This is a clear violation,” said Jordan Libowitz, spokesman for the government watchdog group Citizens for Responsibility and Ethics in Washington. “This is so obviously, blatantly, insultingly a Hatch Act violation that it’s starting to seem like the Trump administration is going out of its way to find new ways to violate the law. We’ll be filing a complaint.”

According to the Office of Special Counsel, which enforces the act, White House employees must be off-duty to participate in or attend a convention event. The law prohibits federal employees from taking part in political activity while in a government building or while wearing an official uniform or insignia.

During the naturalization ceremony, two Marines in dress uniforms opened the door for the president as he entered the room.

According to the Department of Defense, “military service members and federal employees acting in their official capacity may not engage in activities that associate the DOD with any partisan political campaign or elections, candidate, cause or issue,” according to an agency directive and the Hatch Act.

Whether the Marines violated the department directive may depend on whether they knew the event was being filmed for the convention, Clark said.

In a statement earlier Tuesday, White House spokesman Judd Deere said that “RNC Convention events will be planned and executed, at whatever the venue, by the Trump Campaign and RNC. Any government employees who may participate will do so in compliance with the Hatch Act.”

The White House is figuring as a central backdrop for this week’s GOP convention.

On Monday, Trump appeared in two prerecorded videos shot inside the building, one in the East Room and another in the Diplomatic Reception Room.

» READ MORE: Trump is about to give Jeff Van Drew another reward for his ‘loyalty’ and ‘courage’

On Tuesday night, first lady Melania Trump spoke from the Rose Garden. Numerous administration officials appeared to be in attendance, according to video feeds of her speech.

On Thursday, Trump is expected to deliver his official acceptance speech from the South Lawn, which is set to host hundreds of guests.

Earlier this month, the Office of Special Counsel told House Democrats in a letter that while the president is not prohibited from delivering his convention speech on White House grounds, the involvement of White House employees in the event could raise Hatch Act concerns.

For example, White House employees covered by the Hatch Act are barred from assisting with the event while at work or while in a federal building or room, and from attending the event while on duty, Erica S. Hamrick, deputy chief of the office’s Hatch Act unit, wrote in an Aug. 12 letter in response to an inquiry from Rep. Carolyn Maloney, D-N.Y., chairwoman of the House Oversight Committee.

Rooms in the White House residence or those “not regularly used solely in the discharge of official duties are not considered a federal room or building,” Hamrick wrote.

So if a political event takes place on the White House lawn or residence and an employee is off duty, he or she could attend the event, she wrote.

Still, Hamrick noted, all White House employees are barred from using their authority to ask subordinates to do work to support a political event.

The White House, the Trump campaign and the Republican National Convention host committee did not provide specific details Tuesday about how they would ensure executive branch employees acted within federal restrictions.

Roughly a dozen Trump administration officials have been found in violation of the Hatch Act in recent years.

After Special Counsel Henry Kerner recommended the removal of White House senior adviser Kellyanne Conway last year for numerous violations, she brushed off the concerns.

“Blah, blah, blah,” she told reporters. “If you’re trying to silence me through the Hatch Act, it’s not going to work. Let me know when the jail sentence starts.”

» READ MORE: Trump says he won’t fire Kellyanne Conway for violating Hatch Act, defends her ‘free speech’ (from 2019)

Trump has occasionally joked with aides that he would pardon them for Hatch Act violations, former administration officials said.

The Republican National Committee is paying for the catering at Trump’s speech Thursday night at the White House, according to a person familiar with the event who spoke on the condition of anonymity to describe the planning process. The RNC is also expected to pay for logistics, transportation and other related costs for the event.

Party officials have begun estimating how much it will cost to reimburse the government but do not yet have specific figures, according to the person, who added that it will be cheaper to hold Trump’s Thursday speech at the White House than at another venue.

Privately, RNC officials have been dismissive of Hatch Act concerns, saying they attempted to hold Trump’s convention speech in other places but were criticized for drawing a crowd amid the coronavirus pandemic.

While Washington D.C. currently restricts mass gatherings of more than 50 people, that rule does not apply to property owned by the federal government.

Trump was initially annoyed by scrutiny about whether he was using the White House backdrop for political gain during the convention and considered delivering his speech at Civil War battlefield in Gettysburg, Pa., but that was “never really going to happen,” because of logistical concerns, according to a campaign official who spoke on the condition of anonymity to describe the discussions.

The Hatch Act, also known as the “Act to Prevent Pernicious Political Activities,” was signed into law in 1939 by President Franklin D. Roosevelt. Sen. Carl Hatch, D-N.M., introduced the bill amid allegations that Democratic politicians gained an unfair advantage in the 1938 midterms through employees at the Works Progress Administration, a New Deal employment agency.

Trump and Vice President Mike Pence are still subject to restrictions under two other provisions derived from the 1939 law that are enforced by the Justice Department, Clark said.

One is a prohibition on any person from intimidating, commanding or coercing any federal employee to participate in political activity on behalf of any candidate, Clark said. The other is a ban on any employee of the administration from affecting the nomination or the election of any presidential or vice-presidential candidate, she said.

“One of the main purposes of the Hatch Act is to ensure that government authority, including the service of the government employees, are not used for political gain,” she said. “Even though the president isn’t bound by the civil provisions of the Hatch Act, the concern is whether he is improperly exploiting the White House, essentially, as his backdrop for his reelection campaign.”

A number of top White House aides have worked on the convention — including Conway, White House Chief of Staff Mark Meadows and senior adviser Jared Kushner — but officials say they have planned the White House portion of the event in their personal time and will attend in their personal capacities. Ivanka Trump, Trump’s daughter and a senior adviser to the president, is expected to introduce her father at the event.

Making sure that there is a bright line between work done for the convention and official White House duties may be tricky, experts said.

And Jonathan Ladd, associate professor of public policy and government at Georgetown University, said that Trump is breaking with tradition by delivering his convention speech at the White House.

“Presidents and administrations are always trying to get reelected, always trying to get more popular,” Ladd said. “But they’ve always tried to follow the Hatch Act by not having explicit campaign events on government property, including the White House.”

In the past, Trump has privately dismissed concerns about the Hatch Act, sympathizing with aides found to have violated it, according to current and former White House officials.

When asked about the use of the White House for his upcoming acceptance speech, Trump noted the Hatch Act does not apply to him.

“It is legal. There is no Hatch Act, because it doesn’t pertain to the president,” Trump told reporters earlier this month.