This was Donald Trump’s first appearance at the dinner as president.

He attended twice as a private citizen in 2011 and 2015 but since taking office, the president had shunned convention and boycotted the charity event.

In a post on Truth Social last month, he said he did so because “the Press was extraordinarily bad to me, FAKE NEWS ALL, right from the beginning of my First Term, I boycotted the event, and never went as Honoree… However, I look forward to being with everyone this year. Hopefully, it will be something very Special.”

The dinner traditionally offers an opportunity for presidents to interact with members of the press and several — including George W Bush, Ronald Reagan and Barack Obama — have used their addresses to highlight the importance of the media’s role in democracy.

However, throughout both his terms in office, Donald Trump has attacked, sued and threatened journalists and news outlets he believes have been unfair to him.

Trump and Melania sitting at the dinner table.(Reuters)

In this term alone, the president has defunded public media, launched lawsuits against multiple news outlets and made personal attacks against some reporters, including calling female journalists “maggot” and “piggy”.

A number of journalists and media organisations wrote to the White House Correspondents’ Association demanding a condemnation of some of the president’s actions during the dinner, writing “this cannot be business as usual with the press standing up to applaud the man who attacks them on a daily basis”.

But the association responded by saying it was happy the president had accepted the invitation and “we look forward to hosting him”.