The US ambassador to the United Nations broke federal law by retweeting Donald Trump.

Nikki Haley has been reprimanded by the US Office of Special Counsel for violating the Hatch Act, which prohibits most senior government employees from engaging in political activity.

Ms Haley had retweeted a Twitter post by Mr Trump in June endorsing Ralph Norman, a Republican candidate for the House of Representatives who the President said would "be a fantastic help to me in cutting taxes".

Citizens for Responsibility and Ethics in Washington (CREW), a government ethics watchdog, formally complained about the retweet and accused the ambassador of "misusing" her position.

"Ambassador Haley should have known better," said the organisation's director Noah Bookbinder.

In its response to the complaint, the Office of Special Counsel noted Ms Haley had used her personal Twitter to retweet the President's post but said she "gave the impression that she was acting in her official capacity".

Her Twitter profile picture was an official government headshot at the time of the retweet, while her account listed her as US ambassador to the UN and her recent posts were about official matters.

"Retweeting that message, which endorsed a candidate in a congressional election, constituted political activity," wrote Erica Hamrick, deputy chief of the office's Hatch Act unit.

Ms Haley deleted the post after being warned it broke the law and the office "found no evidence that she engaged in any additional prohibited political activity via Twitter," added Ms Hamrick.

She said the ambassador would not be disciplined but had been provided with guidance about her Twitter account.

But Ms Haley was warned further breaches would be considered "a willful and knowing violation of the law, which could result in further action".

She is the third senior Trump official to be reprimanded for misusing their official position following a CREW complaint.

White House social media director Dan Scavino was warned about political tweets in April, while Trump adviser Kellyanne Conway received ethics guidance after using her official position to promote Ivanka Trump's products.

"One is unfortunate, two is a coincidence, but three in less than a year is a pattern," said Mr Bookbinder. "This all stems from the President's permissive attitude towards ethics; the tone is set at the top."

Ms Haley was this week at the centre of a storm of criticism after the US failed to back a United Nations resolution condemning death penalties for gay people who have sex.

The American government said it voted against the resolution because it was concerned it could lead to all executions being banned.