The Trump administration has abruptly dropped its effort to bar CNN reporter Jim Acosta from the White House, but warned he could have his credentials pulled again if he does not follow new guidelines governing journalists’ behaviour.

The White House said reporters would be permitted one question each if called upon at news conferences and allowed follow-ups only at the discretion of the president.

In a letter to Mr Acosta, White House communications director Bill Shine and press secretary Sarah Huckabee Sanders said they will be forced to reconsider the decision “if unprofessional behaviour occurs”.

CNN said it has dropped its lawsuit against the White House filed on Mr Acosta’s behalf.

“Thanks to everyone for their support,” he tweeted. “As I said last Friday … let’s get back to work.”

The White House initially revoked his credentials after he and Mr Trump tangled verbally during a November 7 press conference.

The administration’s initial reasoning was that Mr Acosta had manhandled a White House intern seeking to take his microphone, but that fell apart after Ms Sanders distributed a doctored video sped up to make Mr Acosta look more aggressive than he was.

Instead, the White House focused on behaviour they deemed disrespectful to the president. Mr Acosta and CNN have been frequent targets of a president who has derided coverage of his administration as “fake news” and called the media the enemy of the people.

CNN filed suit to get Mr Acosta’s credentials restored, arguing that the action violated the constitutional right to freedom of the press and that he had been denied due process.

In Washington DC, District Court Judge Timothy Kelly cited the due process argument last Friday in granting Mr Acosta a two-week injunction to get back to work.

The White House initially fought back, saying it had made a preliminary decision to keep Mr Acosta out when the two weeks were up, but after CNN requested a hearing, Mr Shine and Ms Sanders changed course.

“The view from here is that White House interaction with the press is, and generally should be, subject to kind of a natural give and take,” they wrote.

“President Trump believes strongly in the First Amendment and interacts with the press in just such a way. It would be a great loss for all if, instead of this give-and-take, and instead of relying on the professionalism of White House journalists, we were compelled to devise a lengthy and detailed code of conduct.”

They did outline rules compelling journalists at news conferences to physically surrender microphones if the president has not granted them a follow-up question, and said a failure to abide by these standards could result in them losing their passes.

In the November 7 news conference, Mr Acosta and Mr Trump briefly argued over the president’s contention that a group of Latin American migrants headed to the southern US border represented an invasion.

“We are not the enemy of the people,” Mr Acosta tweeted on Monday. “I am not your enemy. You are not my enemy. It is wrong to call your fellow Americans the enemy. We are all on the same team. We are all Americans.”