The Trump administration's top official on counterterrorism has resigned from his position, citing opposition to the war in Iran, and urged the president to reverse course.

In a letter posted on Tuesday to his X account, National Counterterrorism Center Director Joe Kent said that Iran posed no imminent threat to the US and claimed that the Trump administration started this war due to pressure from Israel and its powerful American lobby.

Kent, 45, is a US special forces and CIA veteran whose wife, navy cryptologic technician Shannon Kent, was killed in a suicide bombing in Syria in 2019.

The BBC has contacted the White House for comment on Kent's resignation.

With his departure, Kent becomes the most high-profile figure from within the Trump administration to publicly criticise the US-Israeli operation in Iran.

In the letter, Kent said that he had previously supported Trump's foreign policy platform and until last year had believed that he had understood that the wars in the Middle East robbed America of the precious lives of our patriots and depleted the wealth and prosperity of our nation.

Additionally, Kent alleged that high-ranking Israeli officials and influential US journalists had sowed misinformation that caused Trump to undermine his America First platform.

This echo chamber was used to deceive you into believing that Iran posed an imminent threat to the United States, the letter continued. This was a lie.

Kent, a long-time supporter of Trump's who unsuccessfully ran for Congress twice, was nominated by the president early in his administration and narrowly confirmed to his post, with many Democrats criticising his links to extremist groups including members of the Proud Boys.

In the confirmation hearing, Kent also refused to back away from claims that federal agents had fomented the January 6 riots at the US Capitol or that Trump had won the 2020 election.

At the National Counterterrorism Center, he reported to Director of National Intelligence Tulsi Gabbard and oversaw the analysis and detection of potential terrorist threats from around the globe.

Previously, Kent had deployed 11 times overseas with the US military, including with the US Army's special forces in Iraq.

He later became a paramilitary officer at the CIA before leaving government service after his wife's death.

Kent cited his military service and her death in his letter, saying that he cannot support sending the next generation off to fight and die in a war that serves no benefit to the American people nor justifies the cost of American lives.

There have been a number of resignations among senior officials in the Trump administration, including Security and Exchange Commission enforcement director Margaret Ryan and Kennedy Center President Ric Grenell.

The president's second term, however, has seen far less turnover than his previous tenure at the White House between 2017 and 2021.