Secretary of State Mike Pompeo spoke at the Republican National Convention on Tuesday from Jerusalem, but his participation as a diplomat received strong public backlash for violating the Hatch Act.

Pompeo addressed the RNC in a prerecorded speech from Jerusalem, the city visible in the background. The secretary of state praised President Donald Trump in his speech, but critics said he had flagrantly violated the long-standing Hatch Act, which prohibits federal officials from engaging in political acts while on duty.

“Delivering on this duty to keep us safe and our freedoms intact, this president has led bold initiatives in nearly every corner of the world. In China, he’s pulled back the curtain on the predatory aggression of the Chinese Communist Party. The president has held China accountable for covering up the China virus and allowing it to spread death and economic destruction in America and around the world,” Pompeo said in his prerecorded video speech.

The State Department then released a statement saying Pompeo spoke at the RNC at his personal capacity and did not use government resources. However, Pompeo flew to Israel on a government plane and his trip was funded from tax payers’ money. Pompeo became the first sitting secretary of state to speak at a political convention in 75 years.

In December, the State Department updated its restrictions on the Hatch Act, which Pompeo approved.

“The Department has a long-standing policy of limiting participation in partisan campaigns by its political appointees in recognition of the need for the U.S. Government to speak with one voice on foreign policy matters,” the memo said. “The combination of Department policy and Hatch Act requirements effectively bars you from engaging in partisan political activities while on duty, and, in many circumstances, even when you are off duty.”

Pompeo praised Trump’s foreign policy, talking about a number of his decisions, like the U.S. quitting the Iran nuclear deal and moving the U.S. embassy to Jerusalem – both actions, however, were criticized by U.S. allies at the time. He also praised Trump for ending “the ridiculous unfair trade arrangements with China,” even though only the first phase of a new trade deal has been completed.

“In North Korea, the president lowered the temperature and against all odds, got the North Korean leadership to the table,” he said of the negotiations with North Korean leader Kim Jong Un. The deal to denuclearize North Korea, however, is nowhere in sight.

Democrats slammed Pompeo’s speech, saying that by taking part in a political event he violated the Hatch Act and used tax payers’ money illegally.

Veteran diplomat Wendy Sherman condemned Pompeo in a Twitter post for speaking in front of the Jerusalem city view, using it as a political prop.

Rep. Joaquin Castro (D-Tex.), vice chairman of the House Foreign Affairs Committee, said Pompeo’s speech at the RNC was “a potential violation of federal regulations, U.S. State Department policy, and the Hatch Act.”

“It’s absolutely unacceptable that a sitting U.S. Secretary of State, America’s top diplomat, would use official taxpayer-funded business to participate in a political party convention, particularly after the State Department published guidance that explicitly prohibits such activity,” Castro said.