Sudan's President Omar Hassan al-Bashir speaks during a press conference after the oath of the prime minister and first vice president Bakri Hassan Saleh at the palace in Khartoum, Sudan March 2, 2017. REUTERS/Mohamed Nureldin Abdallah

KHARTOUM (Reuters) - The Sudanese president has replaced his head of security, the state news agency SUNA reported on Sunday, bringing back a senior official who had helped launch a dialogue with the United States after the Sept. 11 attacks in Washington and New York.

The agency said Salah Abdallah Mohamed Saleh, also known as Salah Gosh, who had served as head of the National Intelligence and Security Service (NISS) between 2004 and 2009, had been reinstated, replacing Mohammed Atta al-Moula, who had served in the position since 2009.

Relations between Sudan and the United States have improved under President Donald Trump. Trump last year lifted long-standing sanctions against Sudan, saying it had made progress fighting terrorism and easing humanitarian distress, in a major turnaround for Bashir’s government.

But he kept Sudan on the U.S. list of state sponsors of terrorism - alongside Iran and Syria - which carries a ban on weapons sales and restrictions on U.S. aid, according to U.S. officials.

The news agency gave no reason for the shake-up at the security agency. Moula last week accompanied Sudanese Foreign Minister Ibrahim Ghandour to Cairo for talks with Egyptian officials on topics including security and water issues.

Gosh was detained in 2012 and held for several months on suspicion of “inciting chaos”, “targeting” some leaders and spreading rumors about President Omar Hassan al-Bashir’s health, the information minister said at the time, but Gosh was released without going on trial.

He served as a security adviser to Bashir for two years prior to his arrest.

The New York Times reported in 2005 that U.S. intelligence officials had allowed Gosh to visit the country for consultation with the CIA as a reward for his country’s cooperation in detaining suspected militants and providing information on al Qaeda following the Sept. 11, 2001 attacks.