White House staffers have queued up to say a final farewell to US President Barack Obama ahead of Donald Trump's inauguration on 20 January.

Members of Obama's staff lined up in the hallway outside the Oval Office, some with their partners and children, in order to get a photograph and last hug with the president.

"You're always aware that it's a special privilege to work there and not something to take for granted," Nate Lowentheil, who spent the last three years working on Obama's National Economic Council, told the Associated Press.

"It's particularly hard knowing the next wave of people coming are going to be working to reverse the things you were working to advance until your very last hour."

Obama's staff are currently packing up their desks, and must be out of the White House on Thursday, while the Obamas themselves will be leaving on Friday morning — leaving just hours for the turnaround.

Whitehouse staff say farewell to Obama
US President Barack Obama at a press briefing to thank White House Spokesman Josh Earnest (L) for his work, January 17, 2017. REUTERS/Kevin Lamarque

As part of the packing process, staff leaving the White House will be asked to hand in their badges, mobile phones and computers.

Outgoing White House press secretary Josh Earnest said: "It's been an honour to be a part of it. And yeah, I'm interested in what happens here. And I'll continue to follow it. But I will be relieved to not have the burden to follow it as closely as this job has required over the last two-and-a-half years."

Earnest was praised by Obama on Tuesday (17 January), with the president surprising Earnest in his final White House briefing.

"He's just got that all-American, matinee, good-looking thing going. That's helpful, let's face it. Face made for television," Obama said in comments carried by Politico as he recalled first meeting Earnest in 2008.

"Then the guy's name is Josh Earnest, which, if someone is speaking on your behalf, is a pretty good name to have."

He praised the press secretary — whom Trump has previously slammed — and said it had been a pleasure working with him.

"Of the folks that I've had the great joy and pleasure of working with over the last 10 years on this incredible journey, you know, this guy ranks as high as just about anybody I've worked with," Obama said. "He is not only a great press secretary but more importantly, he is a really, really good man and I'm really, really proud of him."